Commit 4b526715 authored by Eric Timmons's avatar Eric Timmons
Browse files

Fix path-appendable-p

Previous version erroneously said that paths were appendable that shouldn't
have been.
parent c40fcf61
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
          #:alexandria
          #:clpi/defs
          #:clpi/object-store)
  (:import-from #:cl-ppcre)
  (:export #:dual-object-store
           #:dual-object-store-sync
           #:dual-object-store-update-object))
@@ -36,10 +37,9 @@ store, the secondary is updated from the primary and then the secondary is read.
  (setf (gethash path (dual-object-store-updated-paths object-store)) t))

(defun path-appendable-p (path)
  (let ((file-namestring (file-namestring path)))
    (or (starts-with-subseq "releases-" file-namestring)
        (starts-with-subseq "project-index-" file-namestring)
        (starts-with-subseq "system-index-" file-namestring))))
  (or (cl-ppcre:scan "^projects/[^/]*/releases-\\d+$" path)
      (cl-ppcre:scan "^project-index-\\d+$" path)
      (cl-ppcre:scan "^system-index-\\d+$" path)))

(defun dual-object-store-update-object (object-store path)
  (let* ((primary (dual-object-store-primary object-store))