mirror of
https://github.com/BioArchLinux/bioarchlinux-packages.git
synced 2025-03-10 06:24:00 +00:00
fix: make sure batch event is start
This commit is contained in:
parent
21d46e2437
commit
3fa0610b51
2 changed files with 6 additions and 6 deletions
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Change SQL to make sure batch event is `start`
|
||||
|
||||
### Removed
|
||||
|
||||
- Remove `Courier` from font-family
|
||||
|
|
|
@ -19,7 +19,7 @@ code {
|
|||
}
|
||||
</style>"#;
|
||||
|
||||
#[derive(Debug, ToSql, FromSql, Display, PartialEq)]
|
||||
#[derive(Debug, ToSql, FromSql, Display)]
|
||||
#[postgres(name = "batchevent")]
|
||||
enum BatchEvent {
|
||||
#[postgres(name = "start")]
|
||||
|
@ -233,15 +233,11 @@ async fn get_pkg_log(
|
|||
let conn = db.get().await.unwrap();
|
||||
let rows = conn
|
||||
.query(
|
||||
"select * from lilac.batch where ts < $1 order by id desc limit 1",
|
||||
"select logdir from lilac.batch where ts < $1 and event = 'start' order by id desc limit 1",
|
||||
&[&dt],
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let event: BatchEvent = rows[0].get("event");
|
||||
if event != BatchEvent::Start {
|
||||
return HttpResponse::BadRequest().body("wrong time");
|
||||
}
|
||||
let logdir: String = rows[0].get("logdir");
|
||||
let contents =
|
||||
std::fs::read_to_string(format!("/home/lilydjwg/.lilac/log/{}/{}.log", logdir, name))
|
||||
|
|
Loading…
Add table
Reference in a new issue