PCM: update live list in background.

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-09-22 19:39:26 -04:00
parent af2235dc8e
commit 3acdb44a98
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 5 additions and 4 deletions

View File

@ -32,8 +32,7 @@ def cron(every_5m, every_1h, every_1d, every_1mo):
spin_roulette_wheel()
offsitementions.offsite_mentions_task()
if SITE_NAME == 'PCM':
cache.delete_memoized(route_static.live_cached)
route_static.live_cached()
route_static.live_cached(force=True)
if every_1h:
awards.award_timers_bots_task()

View File

@ -443,8 +443,10 @@ if SITE == 'pcmemes.net':
live_thumb_regex = re.compile('\{"thumbnail":\{"thumbnails":\[\{"url":"(.*?)"', flags=re.A)
offline_regex = re.compile('","title":"(.*?)".*?"width":48,"height":48\},\{"url":"(.*?)"', flags=re.A)
@cache.memoize(timeout=86400)
def live_cached():
@cache.memoize(timeout=86400,
forced_update=(lambda force=False: force),
args_to_ignore=["force"])
def live_cached(force=False):
live = []
offline = []
db = db_session()