Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto updating translators based on metadata #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abaevbog
Copy link

@abaevbog abaevbog commented May 8, 2023

Addresses Issue # 1
Automatic translator updates for /web requests. The logic is:

  1. On load, fetch the metadata. Once it is loaded, check if there are new translators in the metadata that are not present in _cache. Load them up as well if so.
  2. Once the request comes in and all relevant translators are fetched, use updateTranslatorIfNeeded function to check if their lastUpdated date is before the lastUpdated date in the metadata. If so, load the translator's code from the repo, update the _cache.
  3. Returns updated (if applicable) translators to translate the items.

@abaevbog
Copy link
Author

abaevbog commented May 8, 2023

@dstillman this does not remove translators that are deleted yet. You mentioned there is some kind of mechanism that needed to be checked. If there is nothing special and any deleted translator is just removed from the metadata, we can check if cached translators' IDs exist in the _metadata when it is fetched and remove it from the cache if it is no there (similar to how handleNewTranslators fetches translators that are in the metadata but not in the cache yet) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant