Skip to content

Commit

Permalink
Bugfix, commit only if query was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudin committed Aug 13, 2021
1 parent 3b74007 commit acf772b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ def get_lexeme_values(self) -> Tuple[int, int, Optional[int]]:
db.add_matches(map(Match.get_match_values, matches))
db.add_texts(map(Match.get_text_values, matches))
db.add_lexeminfo(map(Match.get_lexeme_values, matches))
db.commit()
except ValueError as e:
print("Query failed, skipping", e)
except TimeoutError as e:
print("Query timed out", e)
db.commit()

# Query for the wikimedia language codes #
with open("queries/langcodes.sparql") as f:
Expand Down

0 comments on commit acf772b

Please sign in to comment.