Use Harper readonly mode for Next.js builds#41
Conversation
kriszyp
left a comment
There was a problem hiding this comment.
I believe we need to (somehow) flush all the databases so the new process can "see" all the data.
|
No, I think we will need to add one. |
|
|
||
| // Next.js generates static pages using child processes and only a single process can open the | ||
| // RocksDB databases, so force Harper to start in read-only mode | ||
| process.env.READONLY = 'true'; |
There was a problem hiding this comment.
I'm surprised this wasn't prefixed with like ROCKSDB_ or HARPER_, but thats an upstream thing so no concern here.
|
looks like this needs to wait until Harper is updated (or |
|
Yeah, this PR needs to wait a little bit. |
|
I will convert to draft. Feel free to click the "Ready for Review" button when its good to go again. |
|
We're just waiting on Harper 5.1.0 to ship. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
|
Next.js uses child processes to generate static pages. When those pages reference Harper data, it will try to load those databases and error with:
Harper has a new
READONLYenvironment variable that will allow a RocksDB database to be opened by another process in read-only mode allowing the static pages to be generated.