mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
a11y: add performance test tool
This commit is contained in:
2 files changed
+255
-1
No files matched your search
@@ -1,8 +1,10 @@
|
||||
import { Context, UserModel } from 'hydrooj';
|
||||
import { Context, Schema, UserModel } from 'hydrooj';
|
||||
import { startPerformanceTest } from './performance-test';
|
||||
|
||||
export async function apply(ctx: Context) {
|
||||
// Auto authorize user 2 as super admin
|
||||
ctx.on('handler/after/UserRegisterWithCode#post', async (that) => {
|
||||
if (that.session.uid === 2) await UserModel.setSuperAdmin(2);
|
||||
});
|
||||
ctx.addScript('performance-test', 'test', Schema.object({}), startPerformanceTest);
|
||||
}
|
||||
Reference in new issue
Block a user