fix(apps): Fix cleaning application data background job

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-05-03 12:08:20 +02:00
parent b5f106b0a8
commit aa20f69911
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -8,14 +8,14 @@ defmodule Mobilizon.Service.Workers.CleanApplicationData do
require Logger
@impl Oban.Worker
def perform(%Job{args: %{type: :application}}) do
def perform(%Job{args: %{"type" => "application"}}) do
Logger.info("Cleaning expired applications data")
# TODO: Clear unused applications after a while
end
@impl Oban.Worker
def perform(%Job{args: %{type: :application_token}}) do
def perform(%Job{args: %{"type" => "application_token"}}) do
Logger.info("Cleaning expired application tokens data")
Applications.prune_old_tokens()
@ -23,7 +23,7 @@ defmodule Mobilizon.Service.Workers.CleanApplicationData do
end
@impl Oban.Worker
def perform(%Job{args: %{type: :application_device_activation}}) do
def perform(%Job{args: %{"type" => "application_device_activation"}}) do
Logger.info("Cleaning expired application device activation data")
Applications.prune_old_application_device_activations()