mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: diag: add time to output
This commit is contained in:
3 files changed
+6
-1
No files matched your search
@@ -110,11 +110,13 @@ ${padEnd(formatSeconds(Math.floor((Date.now() - i.pm2_env.pm_uptime) / 1000), fa
|
|||||||
infoDetails[key] = e.message;
|
infoDetails[key] = e.message;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
infoDetails['now'] = new Date().toISOString();
|
||||||
|
infos['now'] = new Date().toISOString();
|
||||||
logger.info('System info:');
|
logger.info('System info:');
|
||||||
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
|
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
|
||||||
logger.info('Uploading detail to pastebin...');
|
logger.info('Uploading detail to pastebin...');
|
||||||
const tmpFile = path.join(tmpdir(), 'report.yaml');
|
const tmpFile = path.join(tmpdir(), 'report.yaml');
|
||||||
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 150 }));
|
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 300 }));
|
||||||
if (process.env.VSCODE_INJECTION) {
|
if (process.env.VSCODE_INJECTION) {
|
||||||
try {
|
try {
|
||||||
child.exec(`code ${tmpFile}`);
|
child.exec(`code ${tmpFile}`);
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export async function apply(ctx: Context) {
|
|||||||
await ctx.parallel('app/listen');
|
await ctx.parallel('app/listen');
|
||||||
logger.success('Server started');
|
logger.success('Server started');
|
||||||
process.send?.('ready');
|
process.send?.('ready');
|
||||||
|
process.title = `HydroOJ (v${global.Hydro.version.hydrooj}, worker ${process.env.NODE_APP_INSTANCE}${process.env.DEV ? ', debug' : ''})`;
|
||||||
await ctx.parallel('app/ready');
|
await ctx.parallel('app/ready');
|
||||||
});
|
});
|
||||||
return { fail };
|
return { fail };
|
||||||
|
|||||||
@@ -449,6 +449,8 @@ class HomeSettingsHandler extends Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class HomeAvatarHandler extends Handler {
|
class HomeAvatarHandler extends Handler {
|
||||||
|
noCheckPermView = true;
|
||||||
|
|
||||||
@param('avatar', Types.String, true)
|
@param('avatar', Types.String, true)
|
||||||
async post({ }, input: string) {
|
async post({ }, input: string) {
|
||||||
if (input) {
|
if (input) {
|
||||||
|
|||||||
Reference in new issue
Block a user