fix: do not await for puter icon write in db (#2485)

This commit is contained in:
Daniel Salazar
2026-02-12 22:43:23 -08:00
committed by GitHub
parent f1a8fdb5c8
commit 4136cb1d24
3 changed files with 5 additions and 2 deletions
@@ -469,10 +469,11 @@ export default class AppService extends BaseService {
const event = {
app_uid: uid,
data_url: object.icon,
url: '',
};
await svc_event.emit('app.new-icon', event);
if ( event.url ) {
await this.db_write.write('UPDATE apps SET icon = ? WHERE uid = ? LIMIT 1',
this.db_write.write('UPDATE apps SET icon = ? WHERE uid = ? LIMIT 1',
[event.url, uid]);
}
}
@@ -225,6 +225,7 @@ class WebServerService extends BaseService {
const link = `\x1B[34;1m${url}\x1B[0m`;
const lines = [
`Puter is now live at: ${link}`,
`listening on port: ${config.http_port}`,
];
const realConsole = globalThis.original_console_object ?? console;
lines.forEach(line => realConsole.log(line));
+2 -1
View File
@@ -175,10 +175,11 @@ class AppES extends BaseES {
const event = {
app_uid: await entity.get('uid'),
data_url: await entity.get('icon'),
url: '',
};
await svc_event.emit('app.new-icon', event);
if ( event.url ) {
await this.db.write('UPDATE apps SET icon = ? WHERE id = ? LIMIT 1',
this.db.write('UPDATE apps SET icon = ? WHERE id = ? LIMIT 1',
[event.url, insert_id]);
await entity.set('icon', event.url);
}