2012-04-06 18:49:54 +00:00
|
|
|
class SnapshotWorker
|
2013-08-04 21:06:56 +00:00
|
|
|
|
2013-07-05 11:30:02 +00:00
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2013-06-14 20:52:55 +00:00
|
|
|
def perform(asciicast_id)
|
2013-08-04 21:06:56 +00:00
|
|
|
asciicast = Asciicast.find(asciicast_id)
|
|
|
|
|
|
|
|
snapshot = SnapshotCreator.new.create(
|
|
|
|
asciicast.terminal_columns,
|
|
|
|
asciicast.terminal_lines,
|
|
|
|
asciicast.stdout,
|
|
|
|
asciicast.duration
|
|
|
|
)
|
|
|
|
|
|
|
|
asciicast.update_snapshot(snapshot)
|
|
|
|
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
# oh well...
|
2013-06-13 22:11:30 +00:00
|
|
|
end
|
2013-08-04 21:06:56 +00:00
|
|
|
|
2012-04-06 18:49:54 +00:00
|
|
|
end
|