From 94f25db1243690d4822341f7c65353da9fd2db8b Mon Sep 17 00:00:00 2001 From: Daniel Daphron Kaczmarek Date: Thu, 25 Aug 2016 11:03:56 -0500 Subject: [PATCH] fixed timing of feeds --- rsstory/rss.py | 8 ++++---- rsstory/user.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rsstory/rss.py b/rsstory/rss.py index 97b498f..9df8d13 100644 --- a/rsstory/rss.py +++ b/rsstory/rss.py @@ -148,13 +148,13 @@ def archive_to_rss(archive_url, time_between_posts, time_units, title, recaptcha job = None if time_units == 'minutes': - job = scheduler.add_job(update_feed, 'interval', args=[feed.id], minutes=1, id=feed.id) + job = scheduler.add_job(update_feed, 'interval', args=[feed.id], minutes=int(time_between_posts), id=feed.id) if time_units == 'hours': - job = scheduler.add_job(update_feed, 'interval', args=[feed.id], hours=1, id=feed.id) + job = scheduler.add_job(update_feed, 'interval', args=[feed.id], hours=int(time_between_posts), id=feed.id) if time_units == 'days': - job = scheduler.add_job(update_feed, 'interval', args=[feed.id], days=1, id=feed.id) + job = scheduler.add_job(update_feed, 'interval', args=[feed.id], days=int(time_between_posts), id=feed.id) if time_units == 'weeks': - job = scheduler.add_job(update_feed, 'interval', args=[feed.id], weeks=1, id=str(feed.id)) + job = scheduler.add_job(update_feed, 'interval', args=[feed.id], weeks=int(time_between_posts), id=str(feed.id)) log.debug("JOB ID: {} added".format(job.id)) return (rss_feed_filename, preview_feed_filename, False) diff --git a/rsstory/user.py b/rsstory/user.py index 4d52f06..9b56277 100644 --- a/rsstory/user.py +++ b/rsstory/user.py @@ -18,7 +18,7 @@ def get_user_feeds(user_id): def update_user_feeds(feed_id, title, time_between, authenticated_user_id): feed = DBSession.query(Feed).filter_by(id=feed_id, user=authenticated_user_id).first() feed.title = title - feed.time_between_posts = int(time_between) * 60 * 24 + feed.time_between_posts = int(time_between) * 60 * 60 log.debug("Trying to update job {} to run every {} seconds".format(feed_id, feed.time_between_posts)) scheduler.reschedule_job(feed.id, trigger='interval', seconds=feed.time_between_posts)