states.rb revision da2294634b553456b3ebb5f5d1ab9dc558b53650
#
# states:
# * pending
# * fetching
# * processing
# * failed
# * done
#
TERMINAL_STATES = %w(failed done)
included do
end
state_changed? &&
end
if last_error
i = ind+2
i+=1
end
msg << out.sub(URI.regexp,"...").sub(/ \/[A-Za-z0-9\/.]*/," ...")
elsif last_error.include?("exited with status")
msg << last_error[0,50]+" ... "+last_error.match("exited with status.*")[0]
else
msg << lines.first
end
end
msg.join(": ")
end
protected
def after_update_state
ontology.state = state.to_s
ontology.save!
if ontology.distributed?
ontology.children.update_all state: ontology.state
end
end
end