Made watchers transient
All checks were successful
Deploy staging on push / pre-build (push) Successful in 1s
Deploy staging on push / build-bot (push) Successful in 3m46s
Deploy staging on push / build-web (push) Successful in 2m5s
Deploy staging on push / deploy (push) Successful in 28s

This commit is contained in:
Sven Heidemann 2023-12-10 13:13:24 +01:00
parent dfb6751bf9
commit 39299eb11b
5 changed files with 6 additions and 6 deletions

View File

@ -62,8 +62,8 @@ class BaseModule(ModuleABC):
services.add_transient(BaseReactionHandler)
services.add_singleton(EventService)
services.add_transient(UserWarningsService)
services.add_singleton(TaskABC, BirthdayWatcher)
services.add_singleton(TaskABC, ScheduledEventsWatcher)
services.add_transient(TaskABC, BirthdayWatcher)
services.add_transient(TaskABC, ScheduledEventsWatcher)
# forms
services.add_transient(BugReportForm)

View File

@ -37,7 +37,7 @@ class BirthdayWatcher(TaskABC):
if not self._is_maintenance():
self.watch.start()
@tasks.loop(time=datetime.time(hour=8, minute=0))
@tasks.loop(time=datetime.time(hour=8, minute=0), reconnect=True)
async def watch(self):
self._logger.info(__name__, "Watching birthdays")
try:

View File

@ -37,7 +37,7 @@ class ScheduledEventsWatcher(TaskABC):
if not self._is_maintenance():
self.watch.start()
@tasks.loop(hours=3)
@tasks.loop(hours=3, reconnect=True)
async def watch(self):
self._logger.info(__name__, "Watching scheduled events")
try:

View File

@ -17,6 +17,6 @@ class SteamSpecialOffersModule(ModuleABC):
pass
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
services.add_singleton(TaskABC, SteamOfferWatcher)
services.add_transient(TaskABC, SteamOfferWatcher)
# commands
# events

View File

@ -187,7 +187,7 @@ class SteamOfferWatcher(TaskABC):
self._logger.trace(__name__, "Finished watching")
return offers_for_notifications
@tasks.loop(hours=4)
@tasks.loop(hours=4, reconnect=True)
async def watch(self):
self._logger.info(__name__, "Watching steam special offers")
try: