set up cronjob to trigger xp calculation daily. set comment for fixes upcoming

This commit is contained in:
Seroxdesign
2023-09-14 06:20:02 -04:00
committed by Alec LaLonde
parent 3a6876efe1
commit 645ff26499
3 changed files with 9 additions and 1 deletions

View File

@@ -9,6 +9,12 @@
schedule: 31 5 * * *
include_in_metadata: true
payload: {}
- name: syncBalances
webhook: '{{ACTION_BASE_ENDPOINT}}/player/syncBalances'
schedule: 0 3 * * *
include_in_metadata: true
payload: {}
comment: Updates user's XP within guild
- name: syncSourceCredLedger
webhook: '{{ACTION_BASE_ENDPOINT}}/syncSourceCredAccounts'
schedule: 0 1 * * *

View File

@@ -109,7 +109,7 @@ export default async (req: Request, res: Response): Promise<void> => {
),
);
const ranks = await client.GetPlayersByTotalXP();
console.log(ranks);
Promise.allSettled(
ranks.xp.map(async ({ playerId, seasonalBalance, balance }, index) => {
const rank = computeRank(index);

View File

@@ -1,3 +1,5 @@
// @to-do change the hardcoded address on line #8 to take a dynamic address once we standardize retrieiving token addresses from ANY guild.
export const PlayerQueries = /* GraphQL */ `
query GetPlayersByTotalXP {
xp(