Fix setting limits

This commit is contained in:
Owen
2026-02-10 21:54:26 -08:00
parent 19b8a6b737
commit 321d77a317
2 changed files with 1 additions and 23 deletions

View File

@@ -21,29 +21,14 @@ class LimitService {
.where(eq(limits.limitId, limitId))
.limit(1);
if (!limit) {
logger.warn(
`Limit with ID ${limitId} not found for org ${orgId}...`
);
continue;
}
// check if its overriden
if (limit.override) {
if (limit && limit.override) {
logger.debug(
`Skipping limit ${limitId} for org ${orgId} since it is overridden...`
);
continue;
}
// dont write if the value is the same
if (limit.value === value) {
logger.debug(
`Skipping limit ${limitId} for org ${orgId} since the value is the same (${value})...`
);
continue;
}
await trx
.insert(limits)
.values({ limitId, orgId, featureId, value, description });