You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have this code to write to the offset every line. However, if I ctrl-c the script, the offset file occasionally (about 1 out of 4) is empty and it starts from beginning. Shouldn't this write be atomic or have some test to verify:
from pygtail import Pygtail
import time
sleep = 1
symbol = 'data.csv'
symbol = 'data/kibot/IBM.txt'
pt = Pygtail(symbol, every_n=1, paranoid=True)
while True:
try:
line = pt.next().strip()
print(line)
except StopIteration:
print("sleep")
time.sleep(sleep)
except Exception as e:
print(str(e))
The text was updated successfully, but these errors were encountered:
Hi, I have this code to write to the offset every line. However, if I ctrl-c the script, the offset file occasionally (about 1 out of 4) is empty and it starts from beginning. Shouldn't this write be atomic or have some test to verify:
The text was updated successfully, but these errors were encountered: