check for existence before refreshing oldest post/account
this only happens when you don't have any accounts yet and it is a bad look the first time you set up a new forget install
This commit is contained in:
parent
fa832412fa
commit
dfcc9287b8
2
tasks.py
2
tasks.py
|
@ -389,6 +389,7 @@ def refresh_account_with_oldest_post():
|
|||
.filter(Account.backoff_until < db.func.now())
|
||||
.filter(~Account.dormant).group_by(Post).order_by(
|
||||
db.asc(Post.updated_at)).first())
|
||||
if post:
|
||||
refresh_account(post.author_id)
|
||||
|
||||
|
||||
|
@ -399,6 +400,7 @@ def refresh_account_with_longest_time_since_refresh():
|
|||
.filter(Account.backoff_until < db.func.now())
|
||||
.filter(~Account.dormant).order_by(db.asc(
|
||||
Account.last_refresh)).first())
|
||||
if acc:
|
||||
refresh_account(acc.id)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue