Skip to content

Commit fe489d9

Browse files
authored
Merge pull request #469 from obeli-sk/persist-switch-at-last
refactor: Activate switched deployment as the last step
2 parents b0ed010 + a5fa9bc commit fe489d9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/command/server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,10 +1484,6 @@ pub(crate) async fn switch_deployment(
14841484
)));
14851485
}
14861486

1487-
conn.activate_deployment(deployment_id, chrono::Utc::now())
1488-
.await
1489-
.map_err(|e| SwitchError::Other(e.into()))?;
1490-
14911487
let old = std::mem::take(&mut ctx.exec_task_handles);
14921488
futures_util::future::join_all(
14931489
old.iter()
@@ -1528,6 +1524,10 @@ pub(crate) async fn switch_deployment(
15281524
closed: false,
15291525
};
15301526

1527+
conn.activate_deployment(deployment_id, chrono::Utc::now())
1528+
.await
1529+
.map_err(|e| SwitchError::Other(e.into()))?;
1530+
15311531
info!(%deployment_id, "Switched to new deployment");
15321532
Ok(SwitchOutcome::Switched)
15331533
} else {

0 commit comments

Comments
 (0)