Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/server/ruby/lib/sonicpi/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ def __stop_job(j)

def __stop_jobs
__info "Stopping all runs..."
@run_count = 0
@user_jobs.each_id do |id|
__stop_job id
end
Expand Down Expand Up @@ -941,6 +942,10 @@ def __spider_eval(code, info={})
__set_default_user_thread_locals!
__msg_queue.push({type: :job, jobid: id, action: :start, jobinfo: info})
@life_hooks.init(id, {:thread => Thread.current})
# run_count is a counter showing how many runs have happened after last stop.
# it is available for user code and enables writing code that depends on it.
@run_count = @run_count ? @run_count + 1 : 0
run_count = @run_count

## fix this for link
__init_spider_time_and_beat!
Expand Down