Add activity expiration worker
This is a worker that runs every minute and deletes expired activities. It's based heavily on the scheduled activities worker.
This commit is contained in:
parent
666514194a
commit
378f5f0fbe
5 changed files with 90 additions and 0 deletions
17
test/activity_expiration_worker_test.exs
Normal file
17
test/activity_expiration_worker_test.exs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.ActivityExpirationWorkerTest do
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.Activity
|
||||
import Pleroma.Factory
|
||||
|
||||
test "deletes an activity" do
|
||||
activity = insert(:note_activity)
|
||||
expiration = insert(:expiration_in_the_past, %{activity_id: activity.id})
|
||||
Pleroma.ActivityExpirationWorker.perform(:execute, expiration.id)
|
||||
|
||||
refute Repo.get(Activity, activity.id)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue