Show More
Commit Description:
removed caching on Configuration...
Commit Description:
removed caching on Configuration git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@285 6386c4cd-e34a-4fa8-8920-d93eb39b512e
File last commit:
Show/Diff file:
Action:
app/models/grader_process.rb | 63 lines | 1.5 KiB | text/x-ruby | RubyLexer |
jittat
started grader_process...
r29 class GraderProcess < ActiveRecord::Base
jittat
renamed ip to host in GraderProcess...
r34 def self.find_by_host_and_pid(host,pid)
jittat
started grader_process...
r29 return GraderProcess.find(:first,
:conditions => {
jittat
renamed ip to host in GraderProcess...
r34 :host => host,
jittat
started grader_process...
r29 :pid => pid
})
end
jittat
renamed ip to host in GraderProcess...
r34
def self.register(host,pid,mode)
grader = GraderProcess.find_by_host_and_pid(host,pid)
jittat
add grader list...
r32 if grader
grader.mode = mode
grader.active = nil
grader.task_id = nil
jittat
[web] updated grader monitoring...
r105 grader.task_type = nil
jittat
add grader list...
r32 grader.save
else
jittat
renamed ip to host in GraderProcess...
r34 grader = GraderProcess.create(:host => host,
jittat
add grader list...
r32 :pid => pid,
:mode => mode)
end
grader
end
def self.find_stalled_process()
GraderProcess.find(:all,
:conditions => ["active AND updated_at < ?",
Time.now.gmtime - GraderProcess.stalled_time])
end
def report_active(task=nil)
self.active = true
jittat
[web] normalize full_score to 100, more hints on how to submit questions, hint on the disabling to test interface during the last 30 minutes...
r125 if task!=nil
self.task_id = task.id
jittat
[web] fixed bug in grader_process update...
r126 self.task_type = task.class.to_s
jittat
[web] normalize full_score to 100, more hints on how to submit questions, hint on the disabling to test interface during the last 30 minutes...
r125 else
self.task_id = nil
jittat
[web] fixed bug in grader_process update...
r126 self.task_type = nil
jittat
[web] normalize full_score to 100, more hints on how to submit questions, hint on the disabling to test interface during the last 30 minutes...
r125 end
jittat
add grader list...
r32 self.save
jittat
started grader_process...
r29 end
jittat
[web] fixed bug in grader_process update...
r126 def report_inactive(task=nil)
jittat
add grader list...
r32 self.active = false
jittat
[web] fixed bug in grader_process update...
r126 if task!=nil
self.task_id = task.id
self.task_type = task.class.to_s
else
self.task_id = nil
self.task_type = nil
end
jittat
add grader list...
r32 self.save
jittat
started grader_process...
r29 end
jittat
add grader list...
r32 protected
def self.stalled_time()
return 1.minute
end
jittat
started grader_process...
r29 end