Skip to content

Commit 1857c7c

Browse files
committed
small fixes
Signed-off-by: Eliott Bouhana <[email protected]>
1 parent 7861291 commit 1857c7c

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
@@ -126,6 +126,7 @@ func (p *DatadogProvider) Init(openfeature.EvaluationContext) error {
126126
func (p *DatadogProvider) Shutdown() {
127127
// Stop the exposure writer
128128
if p.exposureWriter != nil {
129+
p.exposureWriter.flush()
129130
p.exposureWriter.stop()
130131
}
131132

0 commit comments

Comments
 (0)