Created
June 28, 2024 14:08
-
-
Save tlpriest/f3f764eeeee31a440b5401ce3c9283ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schedule = CrontabSchedule.objects.create( | |
minute=self.minute, | |
hour=self.hour, | |
day_of_week=",".join([str(x) for x in self.days_of_week]), | |
timezone=self.team.timezone, | |
) | |
pt, _ = PeriodicTask.objects.update_or_create( | |
name=name, | |
defaults={ | |
"task": "app.api.dofun.tasks.topics.check_for_rain", | |
"args": json.dumps([{"team_id": self.team.id, "schema_name": connection.tenant.schema_name}]), | |
"crontab": schedule, | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment