Skip to content

Commit c5dcc42

Browse files
akosyakovroboquat
authored andcommitted
Revert "[supervisor] improve config watch logging"
This reverts commit 224077d.
1 parent 031707c commit c5dcc42

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/supervisor/pkg/config/gitpod-config.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ func (service *ConfigService) Watch(ctx context.Context) {
8787
return
8888
}
8989

90-
service.waitUntilExistsAndWatch(ctx)
90+
_, err := os.Stat(service.location)
91+
if os.IsNotExist(err) {
92+
service.poll(ctx)
93+
}
94+
service.watch(ctx)
9195
}
9296

9397
func (service *ConfigService) markReady() {
@@ -147,14 +151,14 @@ func (service *ConfigService) scheduleUpdateConfig(ctx context.Context, polling
147151
err := service.updateConfig()
148152
if os.IsNotExist(err) {
149153
polling <- struct{}{}
150-
go service.waitUntilExistsAndWatch(ctx)
154+
go service.poll(ctx)
151155
} else if err != nil {
152156
service.log.WithError(err).Error("gitpod config watcher: failed to parse")
153157
}
154158
})
155159
}
156160

157-
func (service *ConfigService) waitUntilExistsAndWatch(ctx context.Context) {
161+
func (service *ConfigService) poll(ctx context.Context) {
158162
service.markReady()
159163

160164
timer := time.NewTicker(2 * time.Second)

0 commit comments

Comments
 (0)