Repository navigation
iDeploy: write a running deployment's log every 2 s (CLI, reloaded pages) - #387
Merged
Merged
Conversation
The log was written only once the deployment was over: a client that polls (the coming CLI, a page reloaded during a build) saw nothing until the end. It is now also written while the deployment runs, at most every 2 seconds; the timer is cleared once the final log or failure is written.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
idemCLI follows a deployment by pollingGET /api/v1/deploy/:uuid. It does not use the realtime socket, whose host and key are generated at the web build. But a deployment's log was written to the database only once the deployment was over: nothing appeared until the end. Same for a page reloaded during a build.Change
deployment.worker.ts: every log line schedules a write of the kept log, at most every 2 s (LIVE_LOG_FLUSH_MS). The timer is cleared in thefinally, so a late write never overwrites the final log or the failure.Load: one
UPDATEevery 2 s per running deployment.