diff options
author | bnewbold <bnewbold@archive.org> | 2020-01-17 18:45:12 +0000 |
---|---|---|
committer | bnewbold <bnewbold@archive.org> | 2020-01-17 18:45:12 +0000 |
commit | 41c096a435d04dfbb6705542fb3565ac951acae9 (patch) | |
tree | bd2cc65f583f677eeabc42f4010045a536633af6 | |
parent | ba40c9719059c6c33958ec25f84c40bd19712184 (diff) | |
parent | 96df40583576d6a00dd585628bb9569996d038b5 (diff) | |
download | fatcat-41c096a435d04dfbb6705542fb3565ac951acae9.tar.gz fatcat-41c096a435d04dfbb6705542fb3565ac951acae9.zip |
Merge branch 'bnewbold-abstracts-corner-case' into 'master'
fatcatd: fix corner-case in abstracts insertion
See merge request webgroup/fatcat!17
-rw-r--r-- | rust/src/entity_crud.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/src/entity_crud.rs b/rust/src/entity_crud.rs index c0c9e30b..83dd26c9 100644 --- a/rust/src/entity_crud.rs +++ b/rust/src/entity_crud.rs @@ -2395,7 +2395,8 @@ impl EntityCrud for ReleaseEntity { .execute(conn)?; } - // limit is much smaller for abstracts, so don't need to batch + // abstracts-per-release limit is much smaller for abstracts (won't ever hit 65k row + // limit), so don't need to chunk these inserts if !abstract_rows.is_empty() { // Sort of an "upsert"; only inserts new abstract rows if they don't already exist insert_into(abstracts::table) @@ -2403,6 +2404,8 @@ impl EntityCrud for ReleaseEntity { .on_conflict(abstracts::sha1) .do_nothing() .execute(conn)?; + } + if !release_abstract_rows.is_empty() { insert_into(release_rev_abstract::table) .values(release_abstract_rows) .execute(conn)?; |