asciinema.org/app/workers/snapshot_worker.rb

22 lines
395 B
Ruby
Raw Normal View History

2012-04-06 18:49:54 +00:00
class SnapshotWorker
include Sidekiq::Worker
2013-06-14 20:52:55 +00:00
def perform(asciicast_id)
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
2012-04-06 18:49:54 +00:00
end