7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/resque/jobs_controller.rb', line 7
def show
unless meta
self.status = 404
self.content_type = "application/json; charset=utf-8"
self.response_body = '{"message":"not found"}'
return
end
data = {
enqueued_at: meta.enqueued_at,
started_at: meta.started_at,
finished_at: meta.finished_at,
succeeded: meta.succeeded?,
failed: meta.failed?,
progress: meta.progress,
payload: meta['payload']
}
self.status = 200
self.content_type = "application/json; charset=utf-8"
self.response_body = MultiJson.dump(data)
expires_now
end
|