From 15593b518561869d05b9c46e09ae95819f65ce1a Mon Sep 17 00:00:00 2001 From: mytharcher Date: Thu, 22 Aug 2024 21:30:52 +0800 Subject: [PATCH] fix(plugin-data-source-main): fix lock usage --- .../@nocobase/plugin-data-source-main/src/server/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-main/src/server/server.ts b/packages/plugins/@nocobase/plugin-data-source-main/src/server/server.ts index e2948e6c1c..9b77f75f52 100644 --- a/packages/plugins/@nocobase/plugin-data-source-main/src/server/server.ts +++ b/packages/plugins/@nocobase/plugin-data-source-main/src/server/server.ts @@ -316,7 +316,7 @@ export class PluginDataSourceMainServer extends Plugin { this.app.db.on('fields.beforeDestroy', beforeDestroyForeignKey(this.app.db)); this.app.db.on('fields.beforeDestroy', async (model: FieldModel, options) => { - const lockKey = `${this.name}:fields.beforeDestroy:${model.get('collectionName')}:${model.get('name')}`; + const lockKey = `${this.name}:fields.beforeDestroy:${model.get('collectionName')}`; await this.app.lockManager.runExclusive(lockKey, async () => { await model.remove(options);