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
@@ -12,9 +12,9 @@ import (
|
||||
|
||||
const nodeType = "dibs.node"
|
||||
|
||||
// The methods of doc and of the nodes doc:all() returns. Each takes an
|
||||
// optional CSS selector: without one it works on the node itself, with one
|
||||
// on the first match inside it.
|
||||
// nodeMethods are the methods of doc and of the nodes doc:all() returns.
|
||||
// Each takes an optional CSS selector: without one it works on the node
|
||||
// itself, with one on the first match inside it.
|
||||
var nodeMethods = map[string]lua.LGFunction{
|
||||
"text": nodeText,
|
||||
"attr": nodeAttr,
|
||||
@@ -72,7 +72,7 @@ func selector(L *lua.LState, arg int) cascadia.Selector {
|
||||
|
||||
// node:text([sel]) is the visible text of the node or its first match, with
|
||||
// whitespace collapsed. It is nil if nothing matches or the text is empty,
|
||||
// so `if doc:text(sel) then` means "has text". Use exists to test presence.
|
||||
// so `if doc:text(sel) then` means "has text"; exists tests presence.
|
||||
func nodeText(L *lua.LState) int {
|
||||
s := target(L, checkNode(L), 2).First()
|
||||
|
||||
|
||||
Reference in new issue
Block a user