Closed EvanFarrell closed 5 years ago
One of the original purposes of the DATA_DIR
is to have a local cache saved, essentially as a backup, and also for efficiency. Since it's specifically for continuity across runs of the library, I wouldn't want to randomly generate a new directory under /tmp
each time, but it could easily be configured to use a specific directory under /tmp
if desired.
It pulls from an environment variable, so you could probably get away with just setting that, instead of forking?
DATA_DIR = os.environ.get("NOTION_DATA_DIR", str(Path(os.path.expanduser("~")).joinpath(".notion-py")))
If that doesn't meet your need, would love to see a PR in case it's useful to others!
nice! I'll do this, ty
@EvanFarrell Did you ever get this library to run on AWS lamda? I have set the ENV to use /tmp/...
but run into other issues that seem to be caused by Lock
from multiprocessing
@stephensilber Yeah I couldn't get around the Lock
problem, I ended up spinning up a heroku instance
@EvanFarrell I ended up getting it to run really easily on a Google Cloud Compute Function (which is free for the first 2 million calls in a month I believe). I was even able to set up a free Google Cloud scheduler task to run every 1 minute for one of my other notion scripts
For what it's worth, using threads instead of processes as outlined in #61 lets me run what I needed in Lambda
Hey!
I think there should be the way to disable cache, as different platforms have different demands.
I would like to see the option on notion client to disable caching at all.
on write-only containers (with temp dirs) like lambda instances, DATADIR and the likes should be created in
tmp/<path>
. I don't see much downside in doing this in all cases. will be forking for my own purposes, lmk if I should open a PR