Skip to content

Commit 0e32105

Browse files
committed
fix
1 parent 750c42c commit 0e32105

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

components/server/src/redis/publisher.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import { inject, injectable } from "inversify";
88
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
99
import {
10+
HeadlessUpdatesChannel,
1011
PrebuildUpdatesChannel,
12+
RedisHeadlessUpdate,
1113
RedisPrebuildUpdate,
1214
RedisWorkspaceInstanceUpdate,
1315
WorkspaceInstanceUpdatesChannel,
@@ -52,8 +54,19 @@ export class RedisPublisher {
5254
}
5355
}
5456

55-
async publishHeadlessUpdate(): Promise<void> {
57+
async publishHeadlessUpdate(update: RedisHeadlessUpdate): Promise<void> {
5658
log.debug("[redis] Publish headless udpate invoked.");
57-
reportUpdatePublished("headless");
59+
60+
let err: Error | undefined;
61+
try {
62+
const serialized = JSON.stringify(update);
63+
await this.client.publish(HeadlessUpdatesChannel, serialized);
64+
log.debug("[redis] Succesfully published headless update.", update);
65+
} catch (e) {
66+
err = e;
67+
log.error("[redis] Failed to publish headless update.", e, update);
68+
} finally {
69+
reportUpdatePublished("headless", err);
70+
}
5871
}
5972
}

0 commit comments

Comments
 (0)