From 602315dde143c93a128dabed1f6b6c841ee23ee3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 12 Jan 2020 22:23:01 +0000 Subject: [PATCH] partial import --- daemon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index ad5c6cfc..dc0d16c9 100644 --- a/daemon.py +++ b/daemon.py @@ -12,6 +12,7 @@ import json import time import base64 import locale +from functools import partial # used for mime decoding of message POST import email.parser # for saving images @@ -5657,10 +5658,10 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \ serverAddress = ('', proxyPort) if unitTest: - httpd = ThreadingHTTPServer(serverAddress, PubServerUnitTest) + pubHandler = partial(PubServerUnitTest) else: pubHandler = partial(PubServer) - httpd = ThreadingHTTPServer(serverAddress, pubHandler) + httpd = ThreadingHTTPServer(serverAddress, pubHandler) httpd.useBlurHash=useBlurHash httpd.mediaInstance=mediaInstance @@ -5832,7 +5833,7 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \ print('Creating scheduled post thread') httpd.thrPostSchedule= \ threadWithTrace(target=runPostSchedule, \ - args=(baseDir,httpd,20),daemon=True) + args=(baseDir,pubHandler,20),daemon=True) if not unitTest: print('Creating inbox queue watchdog') httpd.thrWatchdog= \