Skip to content

Commit e59d007

Browse files
committed
Fixed up the regex on files
The regex for filtering the durable files needs to match the creation of the names o fhte files, in order to make sure that we don't go looking for files that aren't durable queue files.
1 parent 4d2c409 commit e59d007

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject factual/durable-queue "0.1.6-SNAPSHOT"
1+
(defproject factual/durable-queue "0.1.6"
22
:description "a in-process task-queue that is backed by disk."
33
:license {:name "Eclipse Public License"
44
:url "http://www.eclipse.org/legal/epl-v10.html"}

src/durable_queue.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
any existing files for that queue name."
349349
([directory q-name queue size]
350350
(locking fs-monitor
351-
(let [pattern (re-pattern (str "^" q-name "_(\\d+)"))
351+
(let [pattern (re-pattern (str "^" q-name "_(\\d{6})"))
352352
last-number (->> directory
353353
io/file
354354
.listFiles
@@ -398,8 +398,8 @@
398398
(let [queue->file (->> directory
399399
io/file
400400
.listFiles
401-
(filter #(re-find #"\w+_\d+" (.getName ^File %)))
402-
(group-by #(second (re-find #"(\w+)_\d+" (.getName ^File %)))))]
401+
(filter #(re-find #"^\w+_\d{6}$" (.getName ^File %)))
402+
(group-by #(second (re-find #"^(\w+)_\d{6}$" (.getName ^File %)))))]
403403
(zipmap
404404
(keys queue->file)
405405
(map

0 commit comments

Comments
 (0)