Skip to content

Commit

Permalink
♻️ refactor(translator): Continue writing to cache after setting the …
Browse files Browse the repository at this point in the history
…ignore cache flag.
  • Loading branch information
awwaawwa committed Dec 28, 2024
1 parent 88d85e4 commit 03c4883
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pdf2zh/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def translate(self, text, ignore_cache=False):
return cache

translation = self.do_translate(text)
if not (self.ignore_cache or ignore_cache):
self.cache.set(text, translation)
self.cache.set(text, translation)
return translation

def do_translate(self, text):
Expand Down

0 comments on commit 03c4883

Please sign in to comment.