Skip to content

Etag restoration #52

Answered by junukwon7
junukwon7 asked this question in Q&A
Feb 14, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@undefined-moe
Comment options

Answer selected by junukwon7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants