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_transient(BaseReactionHandler)
|
||||||
services.add_singleton(EventService)
|
services.add_singleton(EventService)
|
||||||
services.add_transient(UserWarningsService)
|
services.add_transient(UserWarningsService)
|
||||||
services.add_singleton(TaskABC, BirthdayWatcher)
|
services.add_transient(TaskABC, BirthdayWatcher)
|
||||||
services.add_singleton(TaskABC, ScheduledEventsWatcher)
|
services.add_transient(TaskABC, ScheduledEventsWatcher)
|
||||||
|
|
||||||
# forms
|
# forms
|
||||||
services.add_transient(BugReportForm)
|
services.add_transient(BugReportForm)
|
||||||
|
@ -37,7 +37,7 @@ class BirthdayWatcher(TaskABC):
|
|||||||
if not self._is_maintenance():
|
if not self._is_maintenance():
|
||||||
self.watch.start()
|
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):
|
async def watch(self):
|
||||||
self._logger.info(__name__, "Watching birthdays")
|
self._logger.info(__name__, "Watching birthdays")
|
||||||
try:
|
try:
|
||||||
|
@ -37,7 +37,7 @@ class ScheduledEventsWatcher(TaskABC):
|
|||||||
if not self._is_maintenance():
|
if not self._is_maintenance():
|
||||||
self.watch.start()
|
self.watch.start()
|
||||||
|
|
||||||
@tasks.loop(hours=3)
|
@tasks.loop(hours=3, reconnect=True)
|
||||||
async def watch(self):
|
async def watch(self):
|
||||||
self._logger.info(__name__, "Watching scheduled events")
|
self._logger.info(__name__, "Watching scheduled events")
|
||||||
try:
|
try:
|
||||||
|
@ -17,6 +17,6 @@ class SteamSpecialOffersModule(ModuleABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
||||||
services.add_singleton(TaskABC, SteamOfferWatcher)
|
services.add_transient(TaskABC, SteamOfferWatcher)
|
||||||
# commands
|
# commands
|
||||||
# events
|
# events
|
||||||
|
@ -187,7 +187,7 @@ class SteamOfferWatcher(TaskABC):
|
|||||||
self._logger.trace(__name__, "Finished watching")
|
self._logger.trace(__name__, "Finished watching")
|
||||||
return offers_for_notifications
|
return offers_for_notifications
|
||||||
|
|
||||||
@tasks.loop(hours=4)
|
@tasks.loop(hours=4, reconnect=True)
|
||||||
async def watch(self):
|
async def watch(self):
|
||||||
self._logger.info(__name__, "Watching steam special offers")
|
self._logger.info(__name__, "Watching steam special offers")
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user