修正一个可能导致用户数据无法插入的bug
This commit is contained in:
parent
2893619194
commit
8b72e59e68
@ -46,7 +46,7 @@ export class TaskStatus {
|
|||||||
export interface ActivityUserClass extends Base, TimeStamps {}
|
export interface ActivityUserClass extends Base, TimeStamps {}
|
||||||
@dbconn()
|
@dbconn()
|
||||||
@index({ address: 1, activity: 1 }, { unique: true })
|
@index({ address: 1, activity: 1 }, { unique: true })
|
||||||
@index({ inviteCode: 1, activity: 1 }, { unique: true })
|
@index({ inviteCode: 1, activity: 1 }, { unique: true, partialFilterExpression: { inviteCode: { $exists: true } } })
|
||||||
@index({ inviteUser: 1, activity: 1 }, { unique: false })
|
@index({ inviteUser: 1, activity: 1 }, { unique: false })
|
||||||
@index({ twitterId: 1 }, { unique: true, partialFilterExpression: { twitterId: { $exists: true } } })
|
@index({ twitterId: 1 }, { unique: true, partialFilterExpression: { twitterId: { $exists: true } } })
|
||||||
@index({ discordId: 1 }, { unique: true, partialFilterExpression: { discordId: { $exists: true } } })
|
@index({ discordId: 1 }, { unique: true, partialFilterExpression: { discordId: { $exists: true } } })
|
||||||
|
@ -27,7 +27,7 @@ const generateBounsCfg = (cfg: any) => {
|
|||||||
let ys = []
|
let ys = []
|
||||||
randoms.forEach((r: number) => {
|
randoms.forEach((r: number) => {
|
||||||
let tmp = cfg.maxBounsScore * r
|
let tmp = cfg.maxBounsScore * r
|
||||||
tmp = Math.min(1, Math.round(tmp))
|
tmp = Math.max(1, Math.round(tmp))
|
||||||
ys.push(tmp)
|
ys.push(tmp)
|
||||||
})
|
})
|
||||||
ys.sort((a: number, b: number) => b - a)
|
ys.sort((a: number, b: number) => b - a)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user