Skip to content

Commit

Permalink
force a sync before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Aug 13, 2024
1 parent c624695 commit 0cfbb67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions ldclient/impl/integrations/files/file_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _poll(self):
break
self._file_times = new_times
if changed:
os.sync()
self._reloader()

def _check_file_times(self):
Expand Down
7 changes: 2 additions & 5 deletions ldclient/testing/test_file_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,8 @@ def make_temp_file(content):
return path

def replace_file(path, content):
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ making a new temp file')
temp_path = make_temp_file(content)
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ renaming temp file from %s to %s' % (temp_path, path))
os.rename(temp_path, path)
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ done')
with open('path', 'w') as f:
f.write(content)

def test_does_not_load_data_prior_to_start():
path = make_temp_file('{"flagValues":{"key":"value"}}')
Expand Down

0 comments on commit 0cfbb67

Please sign in to comment.