Add some minor debug prints
continuous-integration/drone the build was successful Details

This commit is contained in:
Olivier 'reivilibre' 2021-11-23 22:30:46 +00:00
parent d560b860bf
commit eef55632bb
1 changed files with 3 additions and 2 deletions

View File

@ -79,12 +79,12 @@ async fn main() -> anyhow::Result<()> {
matrix_client: Arc::new(client.clone()),
};
eprintln!("Logging in!");
if config.matrix_persist.exists() {
eprintln!("Restoring Matrix session...");
let session: Session = serde_json::from_reader(File::open(config.matrix_persist)?)?;
client.restore_login(session).await?;
} else {
eprintln!("Logging in!");
let session: Session = client
.login(
mxid.localpart(),
@ -94,6 +94,7 @@ async fn main() -> anyhow::Result<()> {
)
.await?
.into();
eprintln!("Persisting Matrix session...");
serde_json::to_writer(File::create(config.matrix_persist)?, &session)?;
}