diff --git a/lib/pleroma/migrators/media_table_migrator.ex b/lib/pleroma/migrators/media_table_migrator.ex index 811f2b85a..f513c074b 100644 --- a/lib/pleroma/migrators/media_table_migrator.ex +++ b/lib/pleroma/migrators/media_table_migrator.ex @@ -72,6 +72,8 @@ defmodule Pleroma.Migrators.MediaTableMigrator do @impl true def handle_info(:process_attachments, state) do + State.clear() + data_migration = data_migration() persistent_data = Map.take(data_migration.data, ["max_processed_id"]) diff --git a/lib/pleroma/migrators/media_table_migrator/state.ex b/lib/pleroma/migrators/media_table_migrator/state.ex index 7a4e43456..6ff3aac32 100644 --- a/lib/pleroma/migrators/media_table_migrator/state.ex +++ b/lib/pleroma/migrators/media_table_migrator/state.ex @@ -12,6 +12,10 @@ defmodule Pleroma.Migrators.MediaTableMigrator.State do Agent.start_link(fn -> @init_state end, name: @reg_name) end + def clear do + Agent.update(@reg_name, fn _state -> @init_state end) + end + def get do Agent.get(@reg_name, & &1) end