[#3259] MediaTableMigrator: state clearance on job restart.
This commit is contained in:
parent
4b10d15e62
commit
90c60993c1
@ -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"])
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user