mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-03 08:00:32 +00:00
Await DB write and add UID cache key
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (24.x) (push) Has been cancelled
test / API tests (node env, api-test) (24.x) (push) Has been cancelled
test / puterjs (node env, vitest) (24.x) (push) Has been cancelled
Make the DB update in AppES awaitable so the write completes before proceeding (avoids race conditions). Also add invalidation of the Redis object key for the app UID in AppInformationService to ensure cached entries keyed by uid are cleared after updates.
This commit is contained in:
@@ -123,6 +123,10 @@ class AppInformationService extends BaseService {
|
||||
value: appUid,
|
||||
rawIcon: false,
|
||||
}),
|
||||
AppRedisCacheSpace.objectKey({
|
||||
lookup: 'uid',
|
||||
value: appUid,
|
||||
}),
|
||||
]),
|
||||
AppRedisCacheSpace.invalidateAppStats(appUid),
|
||||
]);
|
||||
|
||||
@@ -300,7 +300,7 @@ class AppES extends BaseES {
|
||||
};
|
||||
await svc_event.emit('app.new-icon', event);
|
||||
if ( typeof event.url === 'string' && event.url ) {
|
||||
this.db.write(
|
||||
await this.db.write(
|
||||
'UPDATE apps SET icon = ? WHERE id = ? LIMIT 1',
|
||||
[event.url, insert_id],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user