@@ -179,11 +179,19 @@ that's built with Haunt or similar."
(basename
(static-web-site-configuration-directory config)))))
+ (define (record->list record)
+ (let ((fields (record-type-fields <static-web-site-configuration>)))
+ (map (lambda (n)
+ (struct-ref record n))
+ (iota (length fields)))))
+
(map (lambda (config)
;; Add an offset to spread web site updates over the period to avoid I/O
- ;; load peaks when there are several such jobs.
+ ;; load peaks when there are several such jobs. Compute a hash over
+ ;; a list representation of CONFIG, rather than over CONFIG, because
+ ;; hash of a struct depends on the object identity of its vtable.
(let* ((period (static-web-site-configuration-period config))
- (offset (hash config period)))
+ (offset (hash (record->list config) period)))
#~(job (lambda (now)
(let ((elapsed (modulo now #$period)))
(+ now (- #$period elapsed) #$offset)))