Supply explicit time from container to zone-expire-name
This commit is contained in:
parent
863ecf50b6
commit
e8c13053f1
|
@ -184,8 +184,8 @@
|
|||
[(network-reply _ answer)
|
||||
(define-values (new-zone timers) (incorporate-complete-answer answer zone))
|
||||
(transition-and-set-timers new-zone timers)]
|
||||
[(timer-expired (list 'check-dns-expiry name) _)
|
||||
(zone-expire-name zone name)])))))
|
||||
[(timer-expired (list 'check-dns-expiry name) now-msec)
|
||||
(zone-expire-name zone name (/ now-msec 1000.0))])))))
|
||||
|
||||
(struct question-state (zone q client-sock nameservers-tried retry-count) #:transparent)
|
||||
(struct expanding-cnames (q accumulator remaining-count) #:transparent)
|
||||
|
|
|
@ -98,11 +98,10 @@
|
|||
;; CompiledZone DomainName -> CompiledZone
|
||||
;; Checks the given name to see if there are any expiring records, and
|
||||
;; if so, removes them.
|
||||
(define (zone-expire-name db name)
|
||||
(define now (current-inexact-seconds))
|
||||
(define (zone-expire-name db name now-seconds)
|
||||
(define new-expirymap
|
||||
(if (zone-includes-name? db name)
|
||||
(for/hash ([(resource expiry) (hash-ref db name)] #:when (still-valid? expiry now))
|
||||
(for/hash ([(resource expiry) (hash-ref db name)] #:when (still-valid? expiry now-seconds))
|
||||
(values resource expiry))
|
||||
(hash)))
|
||||
(if (zero? (hash-count new-expirymap))
|
||||
|
@ -112,9 +111,10 @@
|
|||
;; CompiledZone -> (values CompiledZone Timers)
|
||||
;; Used to freshen a saved zone when it is loaded from disk.
|
||||
(define (zone-expire zone)
|
||||
(define now-seconds (current-inexact-seconds))
|
||||
(for/fold ([zone zone] [timers (set)])
|
||||
([name (hash-keys zone)])
|
||||
(define new-zone (zone-expire-name zone name))
|
||||
(define new-zone (zone-expire-name zone name now-seconds))
|
||||
(cond
|
||||
[(hash-ref new-zone name #f) =>
|
||||
(lambda (expirymap)
|
||||
|
|
Loading…
Reference in New Issue