debug flag

merge-requests/30/head
Bob Mottram 2020-08-26 12:19:32 +01:00
parent a9db0b03ab
commit 673247abf0
1 changed files with 10 additions and 5 deletions

View File

@ -2414,7 +2414,9 @@ def inboxAfterCapabilities(recentPostsCache: {}, maxRecentPosts: int,
print('ERROR: unable to update ' + boxname + ' index') print('ERROR: unable to update ' + boxname + ' index')
else: else:
if not unitTest: if not unitTest:
print('Saving inbox post as html to cache') if debug:
print('Saving inbox post as html to cache')
htmlCacheStartTime = time.time() htmlCacheStartTime = time.time()
inboxStorePostToHtmlCache(recentPostsCache, inboxStorePostToHtmlCache(recentPostsCache,
maxRecentPosts, maxRecentPosts,
@ -2427,10 +2429,13 @@ def inboxAfterCapabilities(recentPostsCache: {}, maxRecentPosts: int,
postJsonObject, postJsonObject,
allowDeletion, allowDeletion,
boxname) boxname)
timeDiff = \ if debug:
str(int((time.time() - htmlCacheStartTime) * 1000)) timeDiff = \
print('Saved inbox post as html to cache in ' + str(int((time.time() - htmlCacheStartTime) *
timeDiff + ' mS') 1000))
print('Saved ' + boxname +
' post as html to cache in ' +
timeDiff + ' mS')
inboxUpdateCalendar(baseDir, handle, postJsonObject) inboxUpdateCalendar(baseDir, handle, postJsonObject)