Use celery tasks instead of systemd timers for periodic work; and add more tests
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
This commit is contained in:
parent
333476b30b
commit
66ea46cf23
25 changed files with 2133 additions and 104 deletions
|
|
@ -36,3 +36,21 @@ class TwitchConfig(AppConfig):
|
|||
FieldFile.open = _safe_open
|
||||
except (AttributeError, TypeError) as exc:
|
||||
logger.debug("Failed to patch FieldFile.open: %s", exc)
|
||||
|
||||
# Register post_save signal handlers that dispatch image download tasks
|
||||
# when new Twitch records are created.
|
||||
from django.db.models.signals import post_save # noqa: PLC0415
|
||||
|
||||
from twitch.models import DropBenefit # noqa: PLC0415
|
||||
from twitch.models import DropCampaign # noqa: PLC0415
|
||||
from twitch.models import Game # noqa: PLC0415
|
||||
from twitch.models import RewardCampaign # noqa: PLC0415
|
||||
from twitch.signals import on_drop_benefit_saved # noqa: PLC0415
|
||||
from twitch.signals import on_drop_campaign_saved # noqa: PLC0415
|
||||
from twitch.signals import on_game_saved # noqa: PLC0415
|
||||
from twitch.signals import on_reward_campaign_saved # noqa: PLC0415
|
||||
|
||||
post_save.connect(on_game_saved, sender=Game)
|
||||
post_save.connect(on_drop_campaign_saved, sender=DropCampaign)
|
||||
post_save.connect(on_drop_benefit_saved, sender=DropBenefit)
|
||||
post_save.connect(on_reward_campaign_saved, sender=RewardCampaign)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue