mirror of
https://github.com/openzim/zimit.git
synced 2025-09-22 11:22:23 -04:00
Fix logic passing args to crawler
- do not set arg only if value is None or False - remove default value 0 from args (this was not passed but would be with new corrected code and would induce a different crawler behavior in fact)
This commit is contained in:
parent
a73114d140
commit
d24775d70c
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix logic passing args to crawler to support value '0' (#245)
|
||||
|
||||
## [1.6.1] - 2023-11-06
|
||||
|
||||
### Changed
|
||||
|
11
zimit.py
11
zimit.py
@ -151,18 +151,16 @@ def zimit(args=None):
|
||||
"--extraHops",
|
||||
help="Number of extra 'hops' to follow, beyond the current scope",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--limit", help="Limit crawl to this number of pages", type=int, default=0
|
||||
"--limit", help="Limit crawl to this number of pages", type=int
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--maxPageLimit",
|
||||
help="Maximum pages to crawl, overriding pageLimit if both are set",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@ -263,7 +261,6 @@ def zimit(args=None):
|
||||
help="If >0, amount of time to sleep (in seconds) after behaviors "
|
||||
"before moving on to next page",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@ -276,7 +273,6 @@ def zimit(args=None):
|
||||
"--sizeLimit",
|
||||
help="If set, save state and exit if size limit exceeds this value",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@ -291,14 +287,12 @@ def zimit(args=None):
|
||||
"--timeLimit",
|
||||
help="If set, save state and exit after time limit, in seconds",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--healthCheckPort",
|
||||
help="port to run healthcheck on",
|
||||
type=int,
|
||||
default=0,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@ -522,7 +516,8 @@ def get_node_cmd_line(args):
|
||||
"config",
|
||||
]:
|
||||
value = getattr(args, arg)
|
||||
if value:
|
||||
if value == None or (isinstance(value, bool) and value == False):
|
||||
continue
|
||||
node_cmd.append("--" + arg)
|
||||
if not isinstance(value, bool):
|
||||
node_cmd.append(str(value))
|
||||
|
Loading…
x
Reference in New Issue
Block a user