Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue file persists when all data "removed" #218

Open
ajkelsey opened this issue Jul 4, 2024 · 0 comments
Open

Queue file persists when all data "removed" #218

ajkelsey opened this issue Jul 4, 2024 · 0 comments

Comments

@ajkelsey
Copy link

ajkelsey commented Jul 4, 2024

This is my first time using persistent-queue. I've made a short test script to understand how it works. I put() two items into the queue, then get() both. I noticed that the q00000 file remains after the script exits. I also noticed that when I run the script again, it adds to the data already saved in the file.

from persistqueue import Queue
from vehicle import Vehicle

v = Vehicle()
q = Queue('/opt/speedcam/temp', autosave=True)

v.speed = 30
v.direction = 'east'
filename = 'file.dat'

q.put(v)
q.put(filename)

vehicle = q.get()
file = q.get()

print(vehicle.speed)
print(vehicle.direction)
print(filename)



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant