Skip to content

Commit

Permalink
Work harder at cleaning up leftovers, in an attempt to work around "t…
Browse files Browse the repository at this point in the history
…able background_updates already exists"

We regularly encounter issue matrix-org/synapse#14460

This PR attempts harder to cleanup leftovers from previous runs, in particular `homeserver.db`,
hoping that this will help make startup more reliable.
  • Loading branch information
Yoric committed Dec 12, 2022
1 parent c6cf713 commit 28e5201
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,16 +1474,13 @@ pub async fn up(docker: &Docker, config: &Config) -> Result<(), Error> {
let setup_container_name = config.setup_container_name();
let run_container_name = config.run_container_name();

// Create the synapse data directory.
// (Re)create the synapse data directory.
// We'll use it as volume.
let synapse_data_directory = config.synapse_data_dir();
let _ = std::fs::remove_dir_all(&synapse_data_directory);
std::fs::create_dir_all(&synapse_data_directory)
.with_context(|| format!("Cannot create directory {:#?}", synapse_data_directory))?;

// Cleanup leftovers.
let homeserver_path = synapse_data_directory.join("homeserver.yaml");
let _ = std::fs::remove_file(&homeserver_path);

// Start a container to generate homeserver.yaml.
start_synapse_container(
docker,
Expand Down

0 comments on commit 28e5201

Please sign in to comment.