ppf: pass url scoring config to httpd module
This commit is contained in:
8
ppf.py
8
ppf.py
@@ -1223,8 +1223,14 @@ def main():
|
||||
watcherd = None
|
||||
# Start httpd independently when watchd is disabled
|
||||
if config.httpd.enabled:
|
||||
from httpd import ProxyAPIServer
|
||||
from httpd import ProxyAPIServer, configure_url_scoring
|
||||
import network_stats
|
||||
configure_url_scoring(
|
||||
config.ppf.checktime,
|
||||
config.ppf.perfail_checktime,
|
||||
config.ppf.max_fail,
|
||||
config.ppf.list_max_age_days
|
||||
)
|
||||
|
||||
def httpd_stats_provider():
|
||||
"""Stats provider for httpd-only mode (scraping without testing)."""
|
||||
|
||||
@@ -1752,7 +1752,7 @@ class Proxywatchd():
|
||||
|
||||
# Start HTTP API server if enabled
|
||||
if config.httpd.enabled:
|
||||
from httpd import ProxyAPIServer, configure_schedule
|
||||
from httpd import ProxyAPIServer, configure_schedule, configure_url_scoring
|
||||
# Pass schedule config to httpd module
|
||||
configure_schedule(
|
||||
config.watchd.working_checktime,
|
||||
@@ -1760,6 +1760,12 @@ class Proxywatchd():
|
||||
config.watchd.fail_retry_backoff,
|
||||
config.watchd.max_fail
|
||||
)
|
||||
configure_url_scoring(
|
||||
config.ppf.checktime,
|
||||
config.ppf.perfail_checktime,
|
||||
config.ppf.max_fail,
|
||||
config.ppf.list_max_age_days
|
||||
)
|
||||
self.httpd_server = ProxyAPIServer(
|
||||
config.httpd.listenip,
|
||||
config.httpd.port,
|
||||
|
||||
Reference in New Issue
Block a user