judge: allow unlimited access & fix file corruption when errored (#726)

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
Yang Gaoandundefined authored and GitHub committed 2024-02-20 07:39:56 +08:00
1 parent 1f2100b9d1
commit 7ea3c91f5f
6 files changed
+42 -37

No files matched your search

+2 -1
View File
@@ -178,6 +178,7 @@ export class HandlerCommon {
export class Handler extends HandlerCommon {
loginMethods: any;
noCheckPermView = false;
notUsage = false;
allowCors = false;
__param: Record<string, decorators.ParamOption<any>[]>;
@@ -207,7 +208,7 @@ export class Handler extends HandlerCommon {
this.context.pendingError = new CsrfTokenError();
}
}
if (!argv.options.benchmark) await this.limitRate('global', 5, 100);
if (!argv.options.benchmark && !this.notUsage) await this.limitRate('global', 5, 100);
if (!this.noCheckPermView && !this.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) this.checkPerm(PERM.PERM_VIEW);
this.loginMethods = Object.keys(global.Hydro.module.oauth)
.map((key) => ({