mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-08 13:04:26 +08:00
Option to force migrate accounts
This commit is contained in:
parent
15dddc433a
commit
8f67fe50d8
1 changed files with 12 additions and 0 deletions
|
@ -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::<u32>(AnyKey {
|
||||
|
|
Loading…
Add table
Reference in a new issue