mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-25 22:36:38 +00:00
Fix setting limits
This commit is contained in:
@@ -21,29 +21,14 @@ class LimitService {
|
|||||||
.where(eq(limits.limitId, limitId))
|
.where(eq(limits.limitId, limitId))
|
||||||
.limit(1);
|
.limit(1);
|
||||||
|
|
||||||
if (!limit) {
|
|
||||||
logger.warn(
|
|
||||||
`Limit with ID ${limitId} not found for org ${orgId}...`
|
|
||||||
);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if its overriden
|
// check if its overriden
|
||||||
if (limit.override) {
|
if (limit && limit.override) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
`Skipping limit ${limitId} for org ${orgId} since it is overridden...`
|
`Skipping limit ${limitId} for org ${orgId} since it is overridden...`
|
||||||
);
|
);
|
||||||
continue;
|
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
|
await trx
|
||||||
.insert(limits)
|
.insert(limits)
|
||||||
.values({ limitId, orgId, featureId, value, description });
|
.values({ limitId, orgId, featureId, value, description });
|
||||||
|
|||||||
@@ -125,13 +125,6 @@ export class PrivateConfig {
|
|||||||
this.rawPrivateConfig.server.reo_client_id;
|
this.rawPrivateConfig.server.reo_client_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.rawPrivateConfig.stripe?.s3Bucket) {
|
|
||||||
process.env.S3_BUCKET = this.rawPrivateConfig.stripe.s3Bucket;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.rawPrivateConfig.stripe?.s3Region) {
|
|
||||||
process.env.S3_REGION = this.rawPrivateConfig.stripe.s3Region;
|
|
||||||
}
|
|
||||||
if (this.rawPrivateConfig.flags.use_pangolin_dns) {
|
if (this.rawPrivateConfig.flags.use_pangolin_dns) {
|
||||||
process.env.USE_PANGOLIN_DNS =
|
process.env.USE_PANGOLIN_DNS =
|
||||||
this.rawPrivateConfig.flags.use_pangolin_dns.toString();
|
this.rawPrivateConfig.flags.use_pangolin_dns.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user