mirror of
https://github.com/HeyPuter/puter.git
synced 2026-02-17 12:09:53 -06:00
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:
@@ -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',
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
### `ai.prompt.check-usage`
|
||||
|
||||
This event is emitted for ai prompt check usage operations.
|
||||
|
||||
#### Property `completionId`
|
||||
|
||||
completionId
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_ () {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class WebServerService extends BaseService {
|
||||
// }, 1000);
|
||||
next();
|
||||
} catch (e) {
|
||||
console.log('socket auth err', e);
|
||||
console.warn('socket auth err', e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user