-
Notifications
You must be signed in to change notification settings - Fork 1
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
Towards tweaselORG/meta#36: Add auto-archiving script #54
Conversation
be8cee3
to
1fff917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working better than I expected it to. :D Nice!
85e22bf
to
556de9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
556de9d
to
a17891b
Compare
ab78635
to
0ba388d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the typo, this looks good now. You can merge yourself after fixing.
0ba388d
to
4f07270
Compare
This was surprisingly hard to do. Because nodejs caches imports, we need to somehow clear the import cache. This can be done naively (https://ar.al/2021/02/22/cache-busting-in-node.js-dynamic-esm-imports/#cache-invalidation-in-esm-with-dynamic-imports) for plain js files, but it leaks memory and fails for typescript files, since the lodaer doesn’t support it. So, we run each archiving task in a new worker thread that has its own import context. But, since the adapters we are importing are written in typescript, we need to register a loader in the worker context, because it doesn’t have it loaded by default (like the main thread does via `tsx`). Luckly, this feature has just been added to node, but we need to bump our node version to use it. Now we can dynamically import the all chnages to modules.
4f07270
to
05c23e0
Compare
This is based on #32, which needs to be merged first.