File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
components/server/src/redis Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 7
7
import { inject , injectable } from "inversify" ;
8
8
import { log } from "@gitpod/gitpod-protocol/lib/util/logging" ;
9
9
import {
10
+ HeadlessUpdatesChannel ,
10
11
PrebuildUpdatesChannel ,
12
+ RedisHeadlessUpdate ,
11
13
RedisPrebuildUpdate ,
12
14
RedisWorkspaceInstanceUpdate ,
13
15
WorkspaceInstanceUpdatesChannel ,
@@ -52,8 +54,19 @@ export class RedisPublisher {
52
54
}
53
55
}
54
56
55
- async publishHeadlessUpdate ( ) : Promise < void > {
57
+ async publishHeadlessUpdate ( update : RedisHeadlessUpdate ) : Promise < void > {
56
58
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
+ }
58
71
}
59
72
}
You can’t perform that action at this time.
0 commit comments