Compare commits

...

5 Commits

Author SHA1 Message Date
Dzmitry Plashchynski
a7488df85b Bump v1.1.2 2016-12-02 03:42:32 +02:00
Dzmitry Plashchynski
c777933044 Fix PG text limit. Closes #54 2016-12-02 03:41:38 +02:00
Dzmitry Plashchynski
0c2f52d9bc Bump 1.1.1 2016-11-30 01:06:29 +02:00
Dzmitry Plashchynski
33e9794621 Last log instead of Log since it can be truncated 2016-11-30 01:05:47 +02:00
Dzmitry Plashchynski
c336b6d00b Fix empty job_options error 2016-11-30 00:52:54 +02:00
5 changed files with 6 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
PATH
remote: .
specs:
crono (1.1.0)
crono (1.1.2)
activerecord (>= 4.0)
activesupport (>= 4.0)

View File

@@ -9,13 +9,13 @@ module Crono
attr_accessor :performer, :period, :job_args, :last_performed_at, :job_options,
:next_performed_at, :job_log, :job_logger, :healthy, :execution_interval
def initialize(performer, period, job_args, job_options = {})
def initialize(performer, period, job_args, job_options = nil)
self.execution_interval = 0.minutes
self.performer, self.period = performer, period
self.job_args = JSON.generate(job_args)
self.job_log = StringIO.new
self.job_logger = Logger.new(job_log)
self.job_options = job_options
self.job_options = job_options || {}
self.next_performed_at = period.next
@semaphore = Mutex.new
end

View File

@@ -1,3 +1,3 @@
module Crono
VERSION = '1.1.0'
VERSION = '1.1.2'
end

View File

@@ -2,7 +2,7 @@ class CreateCronoJobs < ActiveRecord::Migration
def self.up
create_table :crono_jobs do |t|
t.string :job_id, null: false
t.text :log, limit: 4294967295 # LONGTEXT for MySQL
t.text :log, limit: 1073741823 # LONGTEXT for MySQL
t.datetime :last_performed_at
t.boolean :healthy
t.timestamps null: false

View File

@@ -2,7 +2,7 @@
%a{ href: url('/') }
%i.mdi-navigation-chevron-left
Back to Home
%h4 "#{@job.job_id}" Log:
%h4 "#{@job.job_id}" Last log:
%main.container.blue-grey.lighten-4.grey-text.text-darken-4
- if @job.healthy == false