[#1149] Added Oban job for "activity_expiration". Merged remote-tracking branch ...
[akkoma] / lib / pleroma / workers / scheduled_activity_worker.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Workers.ScheduledActivityWorker do
6 # Note: `max_attempts` is intended to be overridden in `new/1` call
7 use Oban.Worker,
8 queue: "scheduled_activities",
9 max_attempts: 1
10
11 @impl Oban.Worker
12 def perform(%{"op" => "execute", "activity_id" => activity_id}, _job) do
13 Pleroma.ScheduledActivityWorker.perform(:execute, activity_id)
14 end
15 end