From 92e6015164bf0f851e2eea211d72dc92af0e2695 Mon Sep 17 00:00:00 2001 From: girst Date: Wed, 24 Jun 2020 14:01:10 +0200 Subject: [PATCH] fix websub update being overzealous updated all channels every day and getting 5 times the updates :| --- app/common/utils.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/common/utils.py b/app/common/utils.py index 2d041e0..2800e65 100755 --- a/app/common/utils.py +++ b/app/common/utils.py @@ -134,12 +134,13 @@ def update_feed(feed_id, feed_type, verbose): if __name__ == '__main__': if len(sys.argv) < 2 or sys.argv[1] not in ['pull','websub']: - sys.stderr.write(f'Usage: YT_CONFIG=... {sys.argv[0]} pull [-f] [-1] [-v|-vv]\n') - sys.stderr.write(f' YT_CONFIG=... {sys.argv[0]} websub [-1] [-v|-vv]\n') - sys.stderr.write(f'-f: force even if still up-to-date-ish\n') - sys.stderr.write(f'-v: report errors\n') - sys.stderr.write(f'-vv: report accessed feeds\n') - sys.stderr.write(f'-1: limit to one feed (for testing it works)\n') + sys.stderr.write( + f'Usage: YT_CONFIG=... {sys.argv[0]} pull [-f] [-1] [-v|-vv]\n' + f' YT_CONFIG=... {sys.argv[0]} websub [-f] [-1] [-v|-vv]\n' + f'-f: force even if still up-to-date-ish\n' + f'-v: report errors\n' + f'-vv: report accessed feeds\n' + f'-1: limit to one feed (for testing it works)\n') sys.exit(1) verbosity = 2 if '-vv' in sys.argv else 1 if '-v' in sys.argv else 0 @@ -149,4 +150,4 @@ if __name__ == '__main__': if 'pull' in sys.argv: pull_subscriptions(verbosity, force, limit) elif 'websub' in sys.argv: - update_subscriptions(verbosity, limit) + update_subscriptions(verbosity, force, limit) -- 2.39.3