mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 15:39:24 +08:00
chore: ttl of sort field lock
This commit is contained in:
parent
c1db4f2e0c
commit
ce353d7ba8
@ -33,11 +33,17 @@ export class SortField extends Field {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.database.lockManager.runExclusive(this.context.collection.name, async () => {
|
await this.database.lockManager.runExclusive(
|
||||||
const max = await model.max<number, any>(name, { ...options, where });
|
this.context.collection.name,
|
||||||
const newValue = (max || 0) + 1;
|
async () => {
|
||||||
instance.set(name, newValue);
|
const max = await model.max<number, any>(name, { ...options, where });
|
||||||
});
|
const newValue = (max || 0) + 1;
|
||||||
|
instance.set(name, newValue);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ttl: 2000,
|
||||||
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
onScopeChange = async (instance, options) => {
|
onScopeChange = async (instance, options) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user