mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00

* feat: Bind Notification Pipe (#2229) * chore: account page add bind notification modal * feat: timerlock schema and type * feat(fe): bind notification method modal * chore: fe adjust * feat: clean useless code * fix: cron lock * chore: adjust the code * chore: rename api * chore: remove unused code * chore: fe adjust * perf: bind inform ux * fix: time ts * chore: notification (#2251) * perf: send message code * perf: sub schema index * fix: timezone plugin * fix: format --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
26 lines
589 B
TypeScript
26 lines
589 B
TypeScript
import { connectionMongo, getMongoModel } from '../../mongo';
|
|
const { Schema } = connectionMongo;
|
|
import { TimerLockSchemaType } from './type.d';
|
|
|
|
export const collectionName = 'systemtimerlocks';
|
|
|
|
const TimerLockSchema = new Schema({
|
|
timerId: {
|
|
type: String,
|
|
required: true,
|
|
unique: true
|
|
},
|
|
expiredTime: {
|
|
type: Date,
|
|
required: true
|
|
}
|
|
});
|
|
|
|
try {
|
|
TimerLockSchema.index({ expiredTime: 1 }, { expireAfterSeconds: 5 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoTimerLock = getMongoModel<TimerLockSchemaType>(collectionName, TimerLockSchema);
|