Made watchers transient
This commit is contained in:
parent
dfb6751bf9
commit
39299eb11b
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user