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

Add build option to keep cache on resolver teardown #7

Open
WD-stefaang opened this issue Nov 5, 2018 · 2 comments
Open

Add build option to keep cache on resolver teardown #7

WD-stefaang opened this issue Nov 5, 2018 · 2 comments

Comments

@WD-stefaang
Copy link
Contributor

The destructor of the SQL context deletes all files from the cache.
Would it make sense to have an option to keep the local cache alive?
The fetch_asset function would then have to check the local cache.

It could be a bit tricky to compare the date modified between local files and the database version though.

An alternative is to serialize the cache on teardown and attempt to load it on init.

@sirpalee
Copy link
Contributor

I would rather make it an option via environment variables. That makes switching between behaviors way easier, and no need to distribute two different binaries.

Other than this, to make this happen we need to name the local files so they are easier to look up, and make the local cache directory configurable.

@WD-stefaang
Copy link
Contributor Author

Indeed, environment vars are the best way to go.

If you serialize the cache on teardown and try to load it on init, you wouldn't need to make the filenames easier. On the other hand... I'm not using generate_name but a configurable cache dir with simple filenames, unfortunately this prevents the use of multiple versions of the same asset in a single stage (as it gets stored to the same location).

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

No branches or pull requests

2 participants