Add scheduler, rate limiting and headless mode.
Hard-coded 60s URL and 10s host floors with jitter and per-host backoff, shared between dibs processes through a locked state file. The scheduler shuffles due URLs each round and runs one worker per host; 'dibs --headless' watches and logs JSON.
This commit is contained in:
1 parent
bb010356a0
commit
2175c0e5aa
30 files changed
+1434
-126
No files matched your search
@@ -172,9 +172,16 @@ func TestJarSaveLoad(t *testing.T) {
|
||||
if err := NewJar().Load(filepath.Join(t.TempDir(), "missing.json")); err != nil { t.Errorf("missing file: %v", err) }
|
||||
}
|
||||
|
||||
// noLimit lets tests talk to their local server without the host floor.
|
||||
type noLimit struct{}
|
||||
|
||||
func (noLimit) WaitCheck(context.Context, string) error { return nil }
|
||||
|
||||
func newTestClient(t *testing.T, opts Options) *Client {
|
||||
t.Helper()
|
||||
|
||||
if opts.Limiter == nil { opts.Limiter = noLimit{} }
|
||||
|
||||
c, err := New(opts)
|
||||
if err != nil { t.Fatal(err) }
|
||||
|
||||
|
||||
Reference in new issue
Block a user