Skip to content

Commit

Permalink
fix(restart): quieter mode
Browse files Browse the repository at this point in the history
If a user is asking for a `--quiet` restart, he still have lots of messages:

```
Restarting astropaperga on commit xxx
Waiting for deployment to start…
Deployment started (deployment_xxx)
Waiting for application logs…
Deployment successful
```

This fix disable "Waiting messages" and keep only those about deployment starting/result
  • Loading branch information
davlgd authored and miton18 committed Mar 5, 2024
1 parent 49f30ea commit e507113
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/models/log-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ async function watchDeploymentAndDisplayLogs (options) {
redeployDate,
} = options;

Logger.println('Waiting for deployment to start…');
// If in quiet mode, we only log start/finished deployment messages
!quiet && Logger.println('Waiting for deployment to start…');
const deployment = await waitForDeploymentStart({ ownerId, appId, deploymentId, commitId, knownDeployments });
Logger.println(colors.bold.blue(`Deployment started (${deployment.uuid})`));

Expand All @@ -111,7 +112,7 @@ async function watchDeploymentAndDisplayLogs (options) {
logsStream = await displayLogs({ ownerId, appId, deploymentId: deployment.uuid, since: redeployDate, deferred });
}

Logger.println('Waiting for application logs…');
!quiet && Logger.println('Waiting for application logs…');

// Wait for deployment end (or an error thrown by logs with the deferred)
const deploymentEnded = await Promise.race([
Expand Down

0 comments on commit e507113

Please sign in to comment.