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.
12 lines
240 B
Go
12 lines
240 B
Go
//go:build unix
|
|
|
|
package fsutil
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func lockFile(f *os.File) error { return syscall.Flock(int(f.Fd()), syscall.LOCK_EX) }
|
|
func unlockFile(f *os.File) error { return syscall.Flock(int(f.Fd()), syscall.LOCK_UN) }
|