From 8f55138dc571a76fd5b5959c2e7662c1f29c522a Mon Sep 17 00:00:00 2001 From: Menci Date: Mon, 3 Jul 2017 09:50:32 +0800 Subject: [PATCH] Don't make testdata zip if there is a zip --- models/problem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/models/problem.js b/models/problem.js index 3cc6e77..ff0347f 100644 --- a/models/problem.js +++ b/models/problem.js @@ -369,6 +369,7 @@ class Problem extends Model { async makeTestdataZip() { await syzoj.utils.lock(['Promise::Testdata', this.id], async () => { let dir = this.getTestdataPath(); + if (await syzoj.utils.isFile(dir + '.zip')) return; if (!await syzoj.utils.isDir(dir)) throw new ErrorMessage('无测试数据。'); let p7zip = new (require('node-7z'));