Skip to content

Commit 56d1567

Browse files
add stale_age declarations
1 parent 526b13f commit 56d1567

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Registry/Registry.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
164164
populate_known_registries_with_urls!(regs)
165165
regdir = joinpath(depot, "registries")
166166
isdir(regdir) || mkpath(regdir)
167-
Pidfile.mkpidlock(joinpath(regdir, ".pid")) do # only allow one julia process to download and install registries at a time
167+
Pidfile.mkpidlock(joinpath(regdir, ".pid"), stale_age = 60*60) do
168+
# only allow one julia process to download and install registries at a time
168169
registry_urls = pkg_server_registry_urls()
169170
for reg in regs
170171
if reg.path !== nothing && reg.url !== nothing
@@ -394,7 +395,8 @@ function update(regs::Vector{RegistrySpec} = RegistrySpec[]; io::IO=stderr_f(),
394395
for reg in unique(r -> r.uuid, find_installed_registries(io, regs); seen=Set{UUID}())
395396
let reg=reg, errors=errors
396397
regpath = pathrepr(reg.path)
397-
Pidfile.mkpidlock(joinpath(dirname(dirname(reg.path)), ".$(reg.name).pid")) do # only allow one julia process to update a registry at a time
398+
Pidfile.mkpidlock(joinpath(dirname(dirname(reg.path)), ".$(reg.name).pid"), stale_age = 60*60) do
399+
# only allow one julia process to update a registry at a time
398400
let regpath=regpath
399401
if reg.tree_info !== nothing
400402
printpkgstyle(io, :Updating, "registry at " * regpath)

src/Types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function write_env_usage(source_file::AbstractString, usage_filepath::AbstractSt
482482
timestamp = now()
483483

484484
## Atomically write usage file using process id locking
485-
Pidfile.mkpidlock(usage_file * ".pid") do
485+
Pidfile.mkpidlock(usage_file * ".pid", stale_age = 30) do
486486
usage = if isfile(usage_file)
487487
TOML.parsefile(usage_file)
488488
else

0 commit comments

Comments
 (0)