remove lock for leaderboard upates
Some checks failed
commit-tag / commit-tag-image (push) Has been cancelled
Some checks failed
commit-tag / commit-tag-image (push) Has been cancelled
This commit is contained in:
parent
e71183c2a1
commit
4f13f0f80d
@ -18,17 +18,15 @@ export async function update_guild_levels() {
|
|||||||
level: "number",
|
level: "number",
|
||||||
}
|
}
|
||||||
}).assert(ans.data)
|
}).assert(ans.data)
|
||||||
const { db } = await c.getAsync(PG)
|
const { sql } = await c.getAsync(PG)
|
||||||
await db.begin(async (sql) => {
|
for(const [_, guild] of Object.entries(parsed)){
|
||||||
for(const [_, guild] of Object.entries(parsed)){
|
await sql`insert into wynn_guild_info
|
||||||
await sql`insert into wynn_guild_info
|
(uid, name, prefix, xp, level)
|
||||||
(uid, name, prefix, xp, level)
|
values
|
||||||
values
|
(${guild.uuid}, ${guild.name}, ${guild.prefix}, ${guild.xp}, ${guild.level})
|
||||||
(${guild.uuid}, ${guild.name}, ${guild.prefix}, ${guild.xp}, ${guild.level})
|
on conflict (uid) do update set
|
||||||
on conflict (uid) do update set
|
xp = EXCLUDED.xp,
|
||||||
xp = EXCLUDED.xp,
|
level = EXCLUDED.level
|
||||||
level = EXCLUDED.level
|
`
|
||||||
`
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user