File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
packages/sdk/shopify-oxygen/example Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const main = async () => {
4242
4343 miniOxygen . ready . then ( ( ) => {
4444 console . log ( 'Oxygen worker is started...' ) ;
45- console . log ( 'Dispatching fetch every 5 seconds. Press "q" or Ctrl+C to quit...' ) ;
45+ console . log ( 'Press "q" or Ctrl+C to quit...' ) ;
4646
4747 // Dispatch fetch every 5 seconds
4848 const interval = setInterval ( ( ) => {
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ export default {
2222 await ldClient . waitForInitialization ( { timeout : 10 } ) ;
2323 const flagValue = await ldClient . variation ( flagKey , context , false ) ;
2424
25+ // Flush events and close the client
26+ ldClient . flush ( ) ;
27+ ldClient . close ( ) ;
28+
2529 return new Response ( JSON . stringify ( { flagKey, flagValue } ) , { status : 200 } ) ;
2630 } ,
2731} ;
You can’t perform that action at this time.
0 commit comments