Fix recurring task crash
It would fail when inserting a commit into the queue that was already in the queue, instead of just skipping that commit.
This commit is contained in:
parent
2b6c339c70
commit
1da946be10
3 changed files with 13 additions and 13 deletions
12
.sqlx/query-9d51c90afa966740bbd7801c3e6736821d2ab899a6390ec1b66a2067cbcadc25.json
generated
Normal file
12
.sqlx/query-9d51c90afa966740bbd7801c3e6736821d2ab899a6390ec1b66a2067cbcadc25.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "INSERT OR IGNORE INTO queue (hash, date) VALUES (?, ?)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 2
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "9d51c90afa966740bbd7801c3e6736821d2ab899a6390ec1b66a2067cbcadc25"
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"db_name": "SQLite",
|
|
||||||
"query": "INSERT INTO queue (hash, date) VALUES (?, ?)",
|
|
||||||
"describe": {
|
|
||||||
"columns": [],
|
|
||||||
"parameters": {
|
|
||||||
"Right": 2
|
|
||||||
},
|
|
||||||
"nullable": []
|
|
||||||
},
|
|
||||||
"hash": "d620ced558e472a5fe22d5ad365cf25726a7bb969acc8b9411a2591ce7bcc92f"
|
|
||||||
}
|
|
||||||
|
|
@ -19,7 +19,7 @@ pub async fn update(db: &SqlitePool) -> somehow::Result<()> {
|
||||||
for row in new {
|
for row in new {
|
||||||
let date = OffsetDateTime::now_utc();
|
let date = OffsetDateTime::now_utc();
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"INSERT INTO queue (hash, date) VALUES (?, ?)",
|
"INSERT OR IGNORE INTO queue (hash, date) VALUES (?, ?)",
|
||||||
row.hash,
|
row.hash,
|
||||||
date,
|
date,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue