mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
perf: 优化宝塔网站证书在并发部署时导致nginx配置文件错乱的问题
This commit is contained in:
14
packages/core/basic/test.mjs
Normal file
14
packages/core/basic/test.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
import { random } from "lodash-es";
|
||||
import { locker } from "./dist/utils/util.lock.js";
|
||||
|
||||
async function testLocker() {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await locker.execute("test", async () => {
|
||||
console.log("test", i);
|
||||
await new Promise(resolve => setTimeout(resolve, Math.random() * 1000));
|
||||
throw new Error("test error");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await testLocker();
|
||||
Reference in New Issue
Block a user