fix lints
This commit is contained in:
@ -62,7 +62,7 @@ jobs:
|
|||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: ./scripts/test.sh
|
run: ./scripts/test.sh
|
||||||
- name: Upload Test Logs
|
- name: Upload Test Logs
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: nuchat-${{ hashFiles('src/**') }}-${{ hashFiles('tests/**') }}.log
|
name: nuchat-${{ hashFiles('src/**') }}-${{ hashFiles('tests/**') }}.log
|
||||||
path: backend/logs/*
|
path: backend/logs/*
|
||||||
|
|||||||
@ -13,3 +13,7 @@ test:
|
|||||||
default := 'run'
|
default := 'run'
|
||||||
watch CMD=default:
|
watch CMD=default:
|
||||||
watchexec -w src -r just {{CMD}}
|
watchexec -w src -r just {{CMD}}
|
||||||
|
|
||||||
|
lint *ARGS:
|
||||||
|
cargo clippy -- -Dwarnings -Dclippy::correctness -Wclippy::pedantic -Wclippy::perf -Aclippy::missing_errors_doc -Aclippy::missing_panics_doc {{ARGS}}
|
||||||
|
|
||||||
|
|||||||
@ -71,8 +71,8 @@ async fn shutdown_signal(rx: mpsc::Receiver<bool>) {
|
|||||||
let terminate = std::future::pending::<()>();
|
let terminate = std::future::pending::<()>();
|
||||||
|
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = ctrl_c => {},
|
() = ctrl_c => {},
|
||||||
_ = terminate => {},
|
() = terminate => {},
|
||||||
_ = endpoint => {},
|
_ = endpoint => {},
|
||||||
}
|
}
|
||||||
info!("Shutting server down gracefully...");
|
info!("Shutting server down gracefully...");
|
||||||
|
|||||||
@ -49,7 +49,7 @@ fn admin(tx: mpsc::Sender<bool>) -> Router {
|
|||||||
if let Ok(secret) = std::env::var("ADMIN_SECRET") {
|
if let Ok(secret) = std::env::var("ADMIN_SECRET") {
|
||||||
println!("ADMIN_SECRET: {secret}");
|
println!("ADMIN_SECRET: {secret}");
|
||||||
match req.headers().get("Authorization") {
|
match req.headers().get("Authorization") {
|
||||||
Some(key) if secret == key.to_owned() => (),
|
Some(key) if secret == *key => (),
|
||||||
_ => {
|
_ => {
|
||||||
return Response::builder()
|
return Response::builder()
|
||||||
.status(StatusCode::UNAUTHORIZED)
|
.status(StatusCode::UNAUTHORIZED)
|
||||||
|
|||||||
Reference in New Issue
Block a user