From ed2aafc8cff0b346dec9d8378c0e6fe8c3f31e34 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 3 Sep 2020 10:22:23 +0100 Subject: [PATCH] Only run the daemon if this is the main module --- epicyon.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/epicyon.py b/epicyon.py index 276dd32b..fe98b2e0 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1819,21 +1819,22 @@ if YTDomain: if setTheme(baseDir, themeName): print('Theme set to ' + themeName) -runDaemon(args.blogsinstance, args.mediainstance, - args.maxRecentPosts, - not args.nosharedinbox, - registration, args.language, __version__, - instanceId, args.client, baseDir, - domain, onionDomain, i2pDomain, - args.YTReplacementDomain, - port, proxyPort, httpPrefix, - federationList, args.maxMentions, - args.maxEmoji, args.authenticatedFetch, - args.noreply, args.nolike, args.nopics, - args.noannounce, args.cw, ocapAlways, - proxyType, args.maxReplies, - args.domainMaxPostsPerDay, - args.accountMaxPostsPerDay, - args.allowdeletion, debug, False, - args.instanceOnlySkillsSearch, [], - args.blurhash, not args.noapproval) +if __name__ == "__main__": + runDaemon(args.blogsinstance, args.mediainstance, + args.maxRecentPosts, + not args.nosharedinbox, + registration, args.language, __version__, + instanceId, args.client, baseDir, + domain, onionDomain, i2pDomain, + args.YTReplacementDomain, + port, proxyPort, httpPrefix, + federationList, args.maxMentions, + args.maxEmoji, args.authenticatedFetch, + args.noreply, args.nolike, args.nopics, + args.noannounce, args.cw, ocapAlways, + proxyType, args.maxReplies, + args.domainMaxPostsPerDay, + args.accountMaxPostsPerDay, + args.allowdeletion, debug, False, + args.instanceOnlySkillsSearch, [], + args.blurhash, not args.noapproval)