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

feat(doctor): add free disk space check #1284

Merged
merged 1 commit into from
Aug 25, 2020

Conversation

acburdine
Copy link
Member

No description provided.

closes TryGhost#1282
- adds doctor check for system free space

if (!disk) {
// couldn't find a matching disk, early return
// TODO: maybe throw a warning of some sort here?
Copy link
Member

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 🤔

Copy link
Member Author

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();
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Member

@vikaspotluri123 vikaspotluri123 left a 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!

@acburdine acburdine merged commit d5e5ed3 into TryGhost:master Aug 25, 2020
@acburdine acburdine deleted the feat/free-space-check branch August 25, 2020 10:07
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

Successfully merging this pull request may close these issues.

2 participants