Skip to content

Commit

Permalink
feat: Add push source string task
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Mar 3, 2024
1 parent 84397b2 commit 9b9c629
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sentry_sdk
from asyncache import cached
from cachetools import TTLCache
from discord.ext import commands
from discord.ext import commands, tasks

from ..utils import get_now
from .command_tree import CommandTree
Expand Down Expand Up @@ -89,6 +89,11 @@ async def fetch_user(self, user_id: int) -> discord.User | None:
else:
return user

@tasks.loop(minutes=30)
async def push_source_strings(self) -> None:
if self.env in {"prod", "test"}:
await self.translator.push_source_strings()

async def close(self) -> None:
LOGGER_.info("Bot shutting down...")
self.diskcache.close()
Expand Down

0 comments on commit 9b9c629

Please sign in to comment.