MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / lottery

Method lottery

wxapp/wps.js:579–587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

577 }
578
579 async lottery() {
580 const count = await this.lotteryTimes();
581 const limit = Math.min(count, Number(process.env.wps_lottery_limit || 5));
582 for (let i = 1; i <= limit; i++) {
583 const ok = await this.tryLotteryOnce(i);
584 if (!ok) break;
585 await $.wait(1000, 1800);
586 }
587 }
588
589 async run() {
590 $.log(`\n账号[${this.index}] ${mask(this.openid || this.cacheKey)}`);

Callers 1

runMethod · 0.95

Calls 3

lotteryTimesMethod · 0.95
tryLotteryOnceMethod · 0.95
waitMethod · 0.45

Tested by

no test coverage detected