-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
prisma/migrations/20250113235235_daily_rewards_refill_job/migration.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE OR REPLACE FUNCTION schedule_daily_rewards_refill_job() | ||
RETURNS INTEGER | ||
LANGUAGE plpgsql | ||
AS $$ | ||
DECLARE | ||
BEGIN | ||
-- 10 minutes after midnight | ||
INSERT INTO pgboss.schedule (name, cron, timezone) | ||
VALUES ('earnRefill', '10 0 * * *', 'America/Chicago') ON CONFLICT DO NOTHING; | ||
return 0; | ||
EXCEPTION WHEN OTHERS THEN | ||
return 0; | ||
END; | ||
$$; | ||
|
||
SELECT schedule_daily_rewards_refill_job(); | ||
DROP FUNCTION IF EXISTS schedule_daily_rewards_refill_job; |
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
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