cd: make our deploy reliably wait for server to be ready (#2170)

* chore: continue removing extra logs

* cd: make our deploy reliably wait for server to be ready
This commit is contained in:
Daniel Salazar
2025-12-13 14:34:44 -08:00
committed by GitHub
parent e79f8a46f0
commit d7b3ba3bb0
10 changed files with 18 additions and 20 deletions

View File

@@ -1,9 +1,5 @@
export default [
{
id: 'ai.prompt.check-usage',
description: `
This event is emitted for ai prompt check usage operations.
`,
properties: {
completionId: {
type: 'any',

View File

@@ -1,7 +1,3 @@
### `ai.prompt.check-usage`
This event is emitted for ai prompt check usage operations.
#### Property `completionId`
completionId

View File

@@ -1,9 +1,5 @@
// Test extension for event listeners
extension.on('ai.prompt.check-usage', event => {
console.log('GOT AI.PROMPT.CHECK-USAGE EVENT', event);
});
extension.on('ai.prompt.complete', event => {
console.log('GOT AI.PROMPT.COMPLETE EVENT', event);
});

View File

@@ -118,15 +118,11 @@ class PrankGreetService extends BaseService {
await new Promise(rslv => setTimeout(rslv), 5000);
// Display a log message
this.log.noticeme('Hello from PrankGreetService!');
console.debug('Hello from PrankGreetService!');
}
}
```
Typically you'll use `this.log.info('some message')` in your logs
as opposed to `this.log.noticeme(...)`, but the `noticeme` log
level is helpful when debugging.
## Part 4: Implement the Driver Interface in your Service
Now that it has been verified that the service is loaded, we can

View File

@@ -1,5 +1,7 @@
# Logging in Services
# NOTE: You can, and maybe should, just use console log methods, as they are overriden to log through our logger
Services all have a logger available at `this.log`.
```javascript

View File

@@ -222,6 +222,15 @@ class Kernel extends AdvancedBase {
await services.emit('boot.activation');
await services.emit('boot.ready');
// Notify process managers (e.g., PM2 wait_ready) that boot completed
if ( typeof process.send === 'function' ) {
try {
process.send('ready');
} catch ( err ) {
this.bootLogger?.error?.('failed to send ready signal', err);
}
}
}
async install_extern_mods_ () {

View File

@@ -565,9 +565,12 @@ class LogService extends BaseService {
return util.inspect(arg, undefined, undefined, true);
}).join(' '));
};
logconsole.log = logfn('info');
logconsole.info = logfn('info');
logconsole.warn = logfn('warn');
logconsole.error = logfn('error');
logconsole.debug = logfn('debug');
globalThis.console = logconsole;
}

View File

@@ -248,7 +248,7 @@ class WebServerService extends BaseService {
// }, 1000);
next();
} catch (e) {
console.log('socket auth err', e);
console.warn('socket auth err', e);
}
}
});

View File

@@ -187,7 +187,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
for ( const [v_lt_or_eq, files] of available_migrations ) {
if ( v_lt_or_eq + 1 >= TARGET_VERSION && TARGET_VERSION !== HIGHEST_VERSION ) {
this.log.noticeme(`Early exit: target version set to ${TARGET_VERSION}`);
console.warn(`Early exit: target version set to ${TARGET_VERSION}`);
break;
}
if ( user_version <= v_lt_or_eq ) {

View File

@@ -40,7 +40,7 @@ if ( existing_user ) {
replace_name = `system_${ replace_num++}`;
}
log.noticeme('updating existing user called system', {
console.debug('updating existing user called system', {
replace_num,
replace_name,
});