Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
clpm
clpi
Commits
aec0350c
Commit
aec0350c
authored
May 08, 2020
by
Eric Timmons
Browse files
Add INDEX-SYNC generic function
parent
f638af4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/index-defs.lisp
View file @
aec0350c
...
...
@@ -22,6 +22,7 @@
#:index-projects
#:index-release-data-missing
#:index-save
#:index-sync
#:index-system
#:index-system-class
#:index-system-file-class
...
...
@@ -114,6 +115,11 @@ signaled."))
(
:documentation
"Save modifications to INDEX to persistent storage."
))
(
defgeneric
index-sync
(
index
)
(
:documentation
"If INDEX is backed by a dual object store, sync all objects into the
secondary."
))
(
defgeneric
index-system
(
index
system-name
&optional
error
)
(
:documentation
"Return the system with the name SYSTEM-NAME.
...
...
src/index.lisp
View file @
aec0350c
...
...
@@ -141,6 +141,22 @@ object, otherwise error."
(
with-clpi-io-syntax
()
(
pprint
plist
s
)))))
(
defmethod
index-sync
((
index
index
))
(
let
((
object-store
(
index-object-store
index
)))
(
when
(
typep
object-store
'dual-object-store
)
(
dual-object-store-update-object
object-store
"clpi-version"
)
(
dual-object-store-update-object
object-store
"index"
)
(
dolist
(
p
(
index-projects
index
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"repo"
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"authors"
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"maintainers"
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"homepage"
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"releases-object-version"
))
(
dual-object-store-update-object
object-store
(
project-object-path
p
"version-scheme"
))
(
dual-object-store-update-object
object-store
(
project-releases-path
p
)))
(
dolist
(
s
(
index-systems
index
))
(
dual-object-store-update-object
object-store
(
system-object-path
s
"primary-project"
))))))
(
defmethod
index-system
((
index
index
)
system-name
&optional
(
error
t
))
(
multiple-value-bind
(
value
exists-p
)
(
gethash
system-name
(
index-system-ht
index
))
...
...
src/object-store-dual.lisp
View file @
aec0350c
...
...
@@ -91,18 +91,3 @@ older than 60 minutes old."))
(
*
60
60
)))
:binary-p
binary-p
:offset
offset
)))))))
;; (defun dual-index-sync (object-store)
;; "Ensure that every object is present in OBJECT-STORE's secondary."
;; (dual-object-store-update-object object-store "clpi-version")
;; (dual-object-store-update-object object-store "index")
;; (dolist (p (index-projects object-store))
;; (dual-object-store-update-object object-store (project-object-path p "repo"))
;; (dual-object-store-update-object object-store (project-object-path p "authors"))
;; (dual-object-store-update-object object-store (project-object-path p "maintainers"))
;; (dual-object-store-update-object object-store (project-object-path p "homepage"))
;; (dual-object-store-update-object object-store (project-object-path p "releases-object-version"))
;; (dual-object-store-update-object object-store (project-object-path p "version-scheme"))
;; (dual-object-store-update-object object-store (project-releases-path p)))
;; (dolist (s (index-systems object-store))
;; (dual-object-store-update-object object-store (system-object-path s "primary-project"))))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment