Skip to content

Commit 5ba7e00

Browse files
committed
core: diag: add time to output
1 parent 770b2fc commit 5ba7e00

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/hydrooj/src/commands/diagnosis.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ ${padEnd(formatSeconds(Math.floor((Date.now() - i.pm2_env.pm_uptime) / 1000), fa
110110
infoDetails[key] = e.message;
111111
}
112112
}));
113+
infoDetails['now'] = new Date().toISOString();
114+
infos['now'] = new Date().toISOString();
113115
logger.info('System info:');
114116
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
115117
logger.info('Uploading detail to pastebin...');
116118
const tmpFile = path.join(tmpdir(), 'report.yaml');
117-
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 150 }));
119+
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 300 }));
118120
if (process.env.VSCODE_INJECTION) {
119121
try {
120122
child.exec(`code ${tmpFile}`);

packages/hydrooj/src/entry/worker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export async function apply(ctx: Context) {
9494
await ctx.parallel('app/listen');
9595
logger.success('Server started');
9696
process.send?.('ready');
97+
process.title = `HydroOJ (v${global.Hydro.version.hydrooj}, worker ${process.env.NODE_APP_INSTANCE}${process.env.DEV ? ', debug' : ''})`;
9798
await ctx.parallel('app/ready');
9899
});
99100
return { fail };

packages/hydrooj/src/handler/home.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ class HomeSettingsHandler extends Handler {
449449
}
450450

451451
class HomeAvatarHandler extends Handler {
452+
noCheckPermView = true;
453+
452454
@param('avatar', Types.String, true)
453455
async post({ }, input: string) {
454456
if (input) {

0 commit comments

Comments
 (0)