mirror of https://gitlab.com/bashrc2/epicyon
Newswire watchdog arguments
parent
c885fbc384
commit
980f49ff21
|
|
@ -1438,7 +1438,9 @@ def run_daemon(accounts_data_dir: str,
|
||||||
print('THREAD: Creating newswire watchdog')
|
print('THREAD: Creating newswire watchdog')
|
||||||
httpd.thrNewswireWatchdog = \
|
httpd.thrNewswireWatchdog = \
|
||||||
thread_with_trace(target=run_newswire_watchdog,
|
thread_with_trace(target=run_newswire_watchdog,
|
||||||
args=(project_version, httpd), daemon=True)
|
args=(base_dir, httpd,
|
||||||
|
http_prefix, domain, port,
|
||||||
|
httpd.translate), daemon=True)
|
||||||
begin_thread(httpd.thrNewswireWatchdog,
|
begin_thread(httpd.thrNewswireWatchdog,
|
||||||
'run_daemon thrNewswireWatchdog')
|
'run_daemon thrNewswireWatchdog')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ from utils import data_dir
|
||||||
from status import get_status_number
|
from status import get_status_number
|
||||||
from session import create_session
|
from session import create_session
|
||||||
from threads import begin_thread
|
from threads import begin_thread
|
||||||
|
from threads import thread_with_trace
|
||||||
from webapp_hashtagswarm import store_hash_tags
|
from webapp_hashtagswarm import store_hash_tags
|
||||||
from cache import clear_from_post_caches
|
from cache import clear_from_post_caches
|
||||||
|
|
||||||
|
|
@ -897,13 +898,12 @@ def run_newswire_daemon(base_dir: str, httpd,
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
def run_newswire_watchdog(project_version: str, httpd) -> None:
|
def run_newswire_watchdog(base_dir: str, httpd,
|
||||||
|
http_prefix: str, domain: str, port: int,
|
||||||
|
translate: {}) -> None:
|
||||||
"""This tries to keep the newswire update thread running even if it dies
|
"""This tries to keep the newswire update thread running even if it dies
|
||||||
"""
|
"""
|
||||||
print('THREAD: Starting newswire watchdog')
|
print('THREAD: Starting newswire watchdog')
|
||||||
newswire_original = \
|
|
||||||
httpd.thrPostSchedule.clone(run_newswire_daemon)
|
|
||||||
begin_thread(httpd.thrNewswireDaemon, 'run_newswire_watchdog')
|
|
||||||
while True:
|
while True:
|
||||||
time.sleep(50)
|
time.sleep(50)
|
||||||
if httpd.thrNewswireDaemon.is_alive():
|
if httpd.thrNewswireDaemon.is_alive():
|
||||||
|
|
@ -911,6 +911,8 @@ def run_newswire_watchdog(project_version: str, httpd) -> None:
|
||||||
httpd.thrNewswireDaemon.kill()
|
httpd.thrNewswireDaemon.kill()
|
||||||
print('THREAD: restarting newswire watchdog')
|
print('THREAD: restarting newswire watchdog')
|
||||||
httpd.thrNewswireDaemon = \
|
httpd.thrNewswireDaemon = \
|
||||||
newswire_original.clone(run_newswire_daemon)
|
thread_with_trace(target=run_newswire_daemon,
|
||||||
begin_thread(httpd.thrNewswireDaemon, 'run_newswire_watchdog 2')
|
args=(base_dir, httpd,
|
||||||
|
http_prefix, domain, port,
|
||||||
|
translate), daemon=True)
|
||||||
print('Restarting newswire daemon...')
|
print('Restarting newswire daemon...')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue