Skip to content

Commit

Permalink
function to get unique file queues for any type of base queue
Browse files Browse the repository at this point in the history
  • Loading branch information
whalebot-helmsman committed Nov 20, 2018
1 parent 886513c commit a25cf5c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scrapy/core/queues.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import uuid
import os.path


def unique_files_queue(queue_class):

class UniqueFilesQueue(queue_class):
def __init__(self, path):
path = path + "-" + uuid.uuid4().hex
while os.path.exists(path):
path = path + "-" + uuid.uuid4().hex

super().__init__(path)

return UniqueFilesQueue

0 comments on commit a25cf5c

Please sign in to comment.