From 8f67fe50d87b08ac9ec9f2a329000c69eebf2ebb Mon Sep 17 00:00:00 2001 From: mdecimus Date: Fri, 6 Jun 2025 22:01:26 +0200 Subject: [PATCH] Option to force migrate accounts --- crates/migration/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/migration/src/lib.rs b/crates/migration/src/lib.rs index fa79de91..a8320d60 100644 --- a/crates/migration/src/lib.rs +++ b/crates/migration/src/lib.rs @@ -40,6 +40,18 @@ const LOCK_WAIT_TIME_CORE: u64 = 5 * 60; const LOCK_RETRY_TIME: Duration = Duration::from_secs(30); pub async fn try_migrate(server: &Server) -> trc::Result<()> { + if std::env::var("FORCE_MIGRATE_QUEUE").is_ok() { + migrate_queue(server).await.caused_by(trc::location!())?; + } + if let Some(account_id) = std::env::var("FORCE_MIGRATE_ACCOUNT") + .ok() + .and_then(|s| s.parse().ok()) + { + migrate_principal(server, account_id) + .await + .caused_by(trc::location!())?; + } + if server .store() .get_value::(AnyKey {