mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
cache: 'file-expiration-time' uses 'lstat', not 'stat'.
Fixes a bug whereby 'cached-channel-instance' would potentially consider cache entries obsolete too early because they refer to items in the store, which is mounted as 'noatime' on Guix System. * guix/cache.scm (file-expiration-time): Use 'lstat' and 'false-if-exception' rather than 'stat'. This matches what (guix scripts shell) does.
This commit is contained in:
parent
e1c2c2f042
commit
fe3321f91a
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013-2017, 2020-2021, 2023 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
|
@ -55,7 +55,7 @@ (define* (file-expiration-time ttl #:optional (timestamp stat:atime))
|
|||
time\" computed as its timestamp + TTL seconds. Call TIMESTAMP to obtain the
|
||||
relevant timestamp from the result of 'stat'."
|
||||
(lambda (file)
|
||||
(match (stat file #f)
|
||||
(match (false-if-exception (lstat file))
|
||||
(#f 0) ;FILE may have been deleted in the meantime
|
||||
(st (+ (timestamp st) ttl)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue