-
I have some TCs with no etags. I would like to fix it though cli because there are plenty of them. Where does hydro make the infos of TCs? Plz help me. Hydro/packages/hydrooj/src/model/problem.ts Lines 151 to 160 in 3553c2c |
Beta Was this translation helpful? Give feedback.
Answered by
junukwon7
Feb 14, 2021
Replies: 1 comment 1 reply
-
Solved it! Just made a function that only gets and sets the metadata. async function setTestdata(domainId, pid, name) {
const [[, fileinfo]] = await Promise.all([
document.getSub(domainId, document.TYPE_PROBLEM, pid, 'data', name),
]);
const meta = await storage_1.default.getMetaCli(`problem/${domainId}/${pid}/testdata/${name}`);
const payload = { name, ...lodash_1.pick(meta, ['size', 'lastModified', 'etag']) };
await push(domainId, pid, 'data', { _id: name, ...payload });
}
exports.setTestdata = setTestdata; Like this. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
junukwon7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved it! Just made a function that only gets and sets the metadata.
Like this.