Skip to content

Commit

Permalink
fixed timing of feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
malnoxon committed Aug 25, 2016
1 parent ad6a7af commit 94f25db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions rsstory/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rsstory/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94f25db

Please sign in to comment.