You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
415 B
Elixir
16 lines
415 B
Elixir
defmodule Asciinema.Asciicasts.SnapshotUpdater.Exq do
|
|
alias Asciinema.{Repo, Asciicasts}
|
|
alias Asciinema.Asciicasts.Asciicast
|
|
|
|
def update_snapshot(%Asciicast{id: id}) do
|
|
{:ok, _jid} = Exq.enqueue(Exq, "default", __MODULE__, [id])
|
|
:ok
|
|
end
|
|
|
|
def perform(asciicast_id) do
|
|
if asciicast = Repo.get(Asciicast, asciicast_id) do
|
|
{:ok, _} = Asciicasts.update_snapshot(asciicast)
|
|
end
|
|
end
|
|
end
|