Skip to content

Commit

Permalink
Added SLEEP_TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Nov 17, 2022
1 parent fd172a6 commit 9cabfa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RemoteHPC"
uuid = "c4f2a1c4-7655-40d8-82ee-c6ae0a8b7409"
authors = ["louisponet <[email protected]>"]
version = "0.2.2"
version = "0.2.3"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
10 changes: 5 additions & 5 deletions src/runtime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function Base.fill!(qu::Queue, s::Scheduler, init)
end
return qu
end

const SLEEP_TIME = Ref(5.0)
function main_loop(s::Server, submit_channel, queue, main_loop_stop)
fill!(queue, s.scheduler, true)
@info (timestamp = string(Dates.now()), username = get(ENV, "USER", "nouser"),
Expand All @@ -102,15 +102,15 @@ function main_loop(s::Server, submit_channel, queue, main_loop_stop)
catch e
@error "Queue error:" e stacktrace(catch_backtrace())
end
sleep(5)
sleep(SLEEP_TIME[])
end
Threads.@spawn while !main_loop_stop[]
try
handle_job_submission!(queue, s, submit_channel)
catch e
@error "Job submission error:" e stacktrace(catch_backtrace())
end
sleep(5)
sleep(SLEEP_TIME[])
end
Threads.@spawn while !main_loop_stop[]
monitor_issues(log_mtimes)
Expand All @@ -125,7 +125,7 @@ function main_loop(s::Server, submit_channel, queue, main_loop_stop)
message = "self_destruct found, self destructing...")
exit()
end
sleep(5)
sleep(SLEEP_TIME[])
end
fetch(t)
return JSON3.write(config_path("jobs", "queue.json"), queue.info)
Expand Down Expand Up @@ -176,7 +176,7 @@ function handle_job_submission!(queue, s::Server, submit_channel)
curtries = -1
catch e
curtries += 1
sleep(5)
sleep(SLEEP_TIME[])
with_logger(FileLogger(joinpath(job_dir, "submission.err"), append=true)) do
@error e
end
Expand Down

2 comments on commit 9cabfa9

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/72365

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.3 -m "<description of version>" 9cabfa9da2fa010176b67f4793bddd7922f6e362
git push origin v0.2.3

Please sign in to comment.