A bit of clean up
This commit is contained in:
parent
cb2483eab1
commit
a590d7e1e9
24 changed files with 259 additions and 237 deletions
|
|
@ -1,12 +1,12 @@
|
|||
use std::{net::SocketAddr, path::Path};
|
||||
|
||||
use axum::{
|
||||
Router,
|
||||
extract::{ConnectInfo, Extension, FromRef, Request, State},
|
||||
http::StatusCode,
|
||||
middleware::{self, Next},
|
||||
response::Response,
|
||||
routing::{delete, get, post, put},
|
||||
Router,
|
||||
};
|
||||
use axum_extra::extract::cookie::CookieJar;
|
||||
use chrono::prelude::*;
|
||||
|
|
@ -14,7 +14,7 @@ use clap::Parser;
|
|||
use config::Config;
|
||||
use itertools::Itertools;
|
||||
use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||
use tracing::{event, Level};
|
||||
use tracing::{Level, event};
|
||||
|
||||
use data::{db, model};
|
||||
use translation::Tr;
|
||||
|
|
@ -380,11 +380,7 @@ async fn process_args() -> bool {
|
|||
let db_path_bckup = (1..)
|
||||
.find_map(|n| {
|
||||
let p = db_path.with_extension(format!("sqlite.bckup{:03}", n));
|
||||
if p.exists() {
|
||||
None
|
||||
} else {
|
||||
Some(p)
|
||||
}
|
||||
if p.exists() { None } else { Some(p) }
|
||||
})
|
||||
.unwrap();
|
||||
std::fs::copy(&db_path, &db_path_bckup).unwrap_or_else(|error| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue