Skip to content Skip to sidebar Skip to footer

Python Queuelib: Empty And Clear Out Fifodiskqueue

I'm using queuelib and so far it's great! Here is the repo: https://github.com/scrapy/queuelib Is there a way to empty out the FifoDiskQueue?

Solution 1:

The closest thing to a public API for that is to pop all elements one by one:

while queue:
    queue.pop()

This will be inefficient, but it's all they provide.

If you want to live dangerously, you can mess with the implementation details, for example by deleting files and folders manually or by doing something with the private _cleanup method. This would be tricky and fragile, so I don't recommend it.

Post a Comment for "Python Queuelib: Empty And Clear Out Fifodiskqueue"