Skip to content

Commit 2806a62

Browse files
committed
small fixes
Signed-off-by: Eliott Bouhana <[email protected]>
1 parent 3fe521e commit 2806a62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openfeature/exposure.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func (w *exposureWriter) start() {
133133
if r := recover(); r != nil {
134134
log.Error("openfeature: exposure writer recovered panic: %v", r)
135135
}
136+
w.stop()
136137
}()
137138

138139
for {
@@ -243,8 +244,6 @@ func (w *exposureWriter) buildRequestURL() string {
243244

244245
// stop stops the exposure writer and flushes any remaining events
245246
func (w *exposureWriter) stop() {
246-
w.flush()
247-
248247
w.mu.Lock()
249248
if w.stopped {
250249
w.mu.Unlock()

openfeature/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ func (p *DatadogProvider) ShutdownWithContext(ctx context.Context) error {
196196
err := stopRemoteConfig()
197197
// Stop the exposure writer
198198
if p.exposureWriter != nil {
199+
p.exposureWriter.flush()
199200
p.exposureWriter.stop()
200201
}
201202
done <- err

0 commit comments

Comments
 (0)