Merge pull request #18697 from overleaf/dp-ai-rate-limit

Add a rate limiter for the AI Error Assistant

GitOrigin-RevId: d23abc4b3477d13b1bfd4d69db168458ac8c2e51
This commit is contained in:
David 2024-06-18 14:09:38 +01:00 committed by Copybot
parent 7722c44414
commit c16c806002

View file

@ -0,0 +1,20 @@
const mongoose = require('../infrastructure/Mongoose')
const { Schema } = mongoose
const Usage = new Schema({
usage: { type: Number },
periodStart: { type: Date },
})
const UserFeatureUsageSchema = new Schema({
features: {
aiErrorAssistant: Usage,
},
})
exports.UserFeatureUsage = mongoose.model(
'UserFeatureUsage',
UserFeatureUsageSchema
)
exports.UserFeatureUsageSchema = UserFeatureUsageSchema