livetask 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,9 +24,15 @@ module Livetask
24
24
  end
25
25
 
26
26
  def get_log(jid)
27
+ log_array = []
27
28
  Sidekiq.redis do |conn|
28
- conn.get("livetask-#{jid}-log")
29
+ log_array = conn.zrevrangebyscore("livetask-#{jid}-log", '+inf', 0, :with_scores => true)
29
30
  end
31
+ log = ""
32
+ log_array.each do |line|
33
+ log += "#{Time.at(line.last)} #{line.first[5..-1]}\n"
34
+ end
35
+ log
30
36
  end
31
37
 
32
38
  def get_last_changed_at(jid)
@@ -21,9 +21,7 @@ module Livetask
21
21
  return false unless @jid
22
22
  register_task(@jid)
23
23
  Sidekiq.redis do |conn|
24
- string = "[#{Time.now}] #{string}"
25
- string = "\n#{string}" if conn.get("livetask-#{jid}-log")
26
- conn.append("livetask-#{@jid}-log", string)
24
+ conn.zadd("livetask-#{@jid}-log", Time.now.to_i, "#{Time.now.to_i.to_s[-5..-1]}#{string}")
27
25
  end
28
26
  end
29
27
 
@@ -1,3 +1,3 @@
1
1
  module Livetask
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetask
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-25 00:00:00.000000000 Z
12
+ date: 2013-01-30 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Live broadcast from a background job
15
15
  email: