-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
feat(doctor): add free disk space check #1284
Conversation
closes TryGhost#1282 - adds doctor check for system free space
0c1665e
to
a06247e
Compare
|
||
if (!disk) { | ||
// couldn't find a matching disk, early return | ||
// TODO: maybe throw a warning of some sort here? |
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.
We could have a warning that says Unable to determine available free space. We suggest you have at least 1gb of space available.
with a 2s delay 🤔
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.
eventually I want to have the doctor command actually distinguish between "warnings" and "errors" - left this comment to remember to add a warning here whenever that distinction is possible.
const MIN_FREE_SPACE = 1024; | ||
|
||
async function checkFreeSpace(ctx) { | ||
const dir = ctx.instance ? ctx.instance.dir : process.cwd(); |
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.
Can't wait to ctx.instance?.dir ?? process.cwd()
in the future
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.
💯
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.
Logically, everything looks good to me!
No description provided.