Browse Source

Don't make testdata zip if there is a zip

pull/6/head
Menci 8 years ago
parent
commit
8f55138dc5
  1. 1
      models/problem.js

1
models/problem.js

@ -369,6 +369,7 @@ class Problem extends Model {
async makeTestdataZip() { async makeTestdataZip() {
await syzoj.utils.lock(['Promise::Testdata', this.id], async () => { await syzoj.utils.lock(['Promise::Testdata', this.id], async () => {
let dir = this.getTestdataPath(); let dir = this.getTestdataPath();
if (await syzoj.utils.isFile(dir + '.zip')) return;
if (!await syzoj.utils.isDir(dir)) throw new ErrorMessage('无测试数据。'); if (!await syzoj.utils.isDir(dir)) throw new ErrorMessage('无测试数据。');
let p7zip = new (require('node-7z')); let p7zip = new (require('node-7z'));

Loading…
Cancel
Save