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
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
)
|
||||
|
||||
// Ranges for the [sandbox] limits.
|
||||
const (
|
||||
minSandboxTimeout = 100 * time.Millisecond
|
||||
maxSandboxTimeout = 30 * time.Second
|
||||
@@ -47,7 +46,6 @@ var goTypeNames = map[string]string{
|
||||
"config.Duration": `a duration string such as "3m"`,
|
||||
}
|
||||
|
||||
// Error is one problem in the config file.
|
||||
type Error struct {
|
||||
File string
|
||||
Line int // 1-based; 0 if unknown
|
||||
@@ -71,7 +69,7 @@ func (e Error) Error() string {
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// Errors is every problem found in one config file, sorted by position.
|
||||
// Errors is sorted by position in the file.
|
||||
type Errors []Error
|
||||
|
||||
func (es Errors) Error() string {
|
||||
@@ -99,8 +97,8 @@ func (v *validator) decodeError(de *toml.DecodeError, msg string) {
|
||||
msg = friendlyDecodeMsg(strings.TrimPrefix(de.Error(), "toml: "))
|
||||
}
|
||||
|
||||
// The decoder's key has no array indexes, so prefer the indexed path of
|
||||
// the key at that position.
|
||||
// The decoder's key has no array indexes; the key indexed at the same
|
||||
// position has them.
|
||||
key := v.pos.keyAt(line, col)
|
||||
if key == "" {
|
||||
key = strings.Join(de.Key(), ".")
|
||||
|
||||
Reference in new issue
Block a user