mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: remove deprecated generationTime usage
This commit is contained in:
2 files changed
+3
-4
No files matched your search
@@ -417,7 +417,7 @@ const ledo = buildContestRule({
|
|||||||
value: tsddict[pid]?.penaltyScore || '',
|
value: tsddict[pid]?.penaltyScore || '',
|
||||||
hover: tsddict[pid]?.ntry ? `-${tsddict[pid].ntry} (${Math.round(Math.max(0.7, 0.95 ** tsddict[pid].ntry) * 100)}%)` : '',
|
hover: tsddict[pid]?.ntry ? `-${tsddict[pid].ntry} (${Math.round(Math.max(0.7, 0.95 ** tsddict[pid].ntry) * 100)}%)` : '',
|
||||||
raw: tsddict[pid]?.rid,
|
raw: tsddict[pid]?.rid,
|
||||||
style: tsddict[pid]?.status === STATUS.STATUS_ACCEPTED && tsddict[pid]?.rid.generationTime === meta?.first?.[pid]
|
style: tsddict[pid]?.status === STATUS.STATUS_ACCEPTED && tsddict[pid]?.rid.getTimestamp().getTime() === meta?.first?.[pid]
|
||||||
? 'background-color: rgb(217, 240, 199);'
|
? 'background-color: rgb(217, 240, 199);'
|
||||||
: undefined,
|
: undefined,
|
||||||
});
|
});
|
||||||
@@ -438,13 +438,13 @@ const homework = buildContestRule({
|
|||||||
if (tdoc.pids.includes(j.pid)) effective[j.pid] = j;
|
if (tdoc.pids.includes(j.pid)) effective[j.pid] = j;
|
||||||
}
|
}
|
||||||
function time(jdoc) {
|
function time(jdoc) {
|
||||||
const real = jdoc.rid.generationTime - tdoc.beginAt.getTime() / 1000;
|
const real = (jdoc.rid.getTimestamp().getTime() - tdoc.beginAt.getTime()) / 1000;
|
||||||
return Math.floor(real);
|
return Math.floor(real);
|
||||||
}
|
}
|
||||||
|
|
||||||
function penaltyScore(jdoc) {
|
function penaltyScore(jdoc) {
|
||||||
const exceedSeconds = Math.floor(
|
const exceedSeconds = Math.floor(
|
||||||
jdoc.rid.generationTime - tdoc.penaltySince.getTime() / 1000,
|
(jdoc.rid.getTimestamp().getTime() - tdoc.penaltySince.getTime()) / 1000,
|
||||||
);
|
);
|
||||||
if (exceedSeconds < 0) return jdoc.score;
|
if (exceedSeconds < 0) return jdoc.score;
|
||||||
let coefficient = 1;
|
let coefficient = 1;
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ SystemSetting(
|
|||||||
Setting('setting_session', 'session.unsaved_expire_seconds', 3600 * 3,
|
Setting('setting_session', 'session.unsaved_expire_seconds', 3600 * 3,
|
||||||
'number', 'session.unsaved_expire_seconds', 'Unsaved session expire seconds'),
|
'number', 'session.unsaved_expire_seconds', 'Unsaved session expire seconds'),
|
||||||
Setting('setting_storage', 'db.ver', 0, 'number', 'db.ver', 'Database version', FLAG_DISABLED | FLAG_HIDDEN),
|
Setting('setting_storage', 'db.ver', 0, 'number', 'db.ver', 'Database version', FLAG_DISABLED | FLAG_HIDDEN),
|
||||||
Setting('setting_storage', 'system.webmanage', 'disabled', 'text', 'system.webmanage', 'Enable web manage', FLAG_DISABLED | FLAG_HIDDEN),
|
|
||||||
Setting('setting_storage', 'installid', String.random(64), 'text', 'installid', 'Installation ID', FLAG_HIDDEN | FLAG_DISABLED),
|
Setting('setting_storage', 'installid', String.random(64), 'text', 'installid', 'Installation ID', FLAG_HIDDEN | FLAG_DISABLED),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user