Skip to content

Commit 0cfbb67

Browse files
committed
force a sync before reading
1 parent c624695 commit 0cfbb67

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

ldclient/impl/integrations/files/file_data_source.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def _poll(self):
218218
break
219219
self._file_times = new_times
220220
if changed:
221+
os.sync()
221222
self._reloader()
222223

223224
def _check_file_times(self):

ldclient/testing/test_file_data_source.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,8 @@ def make_temp_file(content):
119119
return path
120120

121121
def replace_file(path, content):
122-
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ making a new temp file')
123-
temp_path = make_temp_file(content)
124-
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ renaming temp file from %s to %s' % (temp_path, path))
125-
os.rename(temp_path, path)
126-
log.error('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ done')
122+
with open('path', 'w') as f:
123+
f.write(content)
127124

128125
def test_does_not_load_data_prior_to_start():
129126
path = make_temp_file('{"flagValues":{"key":"value"}}')

0 commit comments

Comments
 (0)