Skip to content

Commit

Permalink
Background task
Browse files Browse the repository at this point in the history
  • Loading branch information
mouredev committed Feb 23, 2024
1 parent 4a0d269 commit f7dbbf0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions link_bio/link_bio/state/PageState.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ class PageState(rx.State):
next_live: str = ""
featured_info: list[Featured]

@rx.background
async def check_live(self):
self.live_status = await live(USER)
if not self.live_status.live:
self.next_live = utils.next_date(await schedule())
async with self:
self.live_status = await live(USER)
if not self.live_status.live:
self.next_live = utils.next_date(await schedule())

@rx.background
async def featured_links(self):
self.featured_info = await featured()
async with self:
self.featured_info = await featured()

0 comments on commit f7dbbf0

Please sign in to comment.