Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feature: Load workspace build logs from streaming#1997

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 10 commits intomainfrombq/stream-logs
Jun 3, 2022
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix lint
  • Loading branch information
@BrunoQuaresma
BrunoQuaresma committedJun 2, 2022
commit7232e6548fec797b93a6988b1e11cf4bebc1dd15
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,7 +123,7 @@ export const workspaceBuildMachine = createMachine(
const reader = await API.streamWorkspaceBuildLogs(ctx.buildId)

// Watching for the stream
// eslint-disable-next-line no-constant-condition
// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
while (true) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to worry about error handling or cleanup ifdone never returns?

Copy link
CollaboratorAuthor

@BrunoQuaresmaBrunoQuaresmaJun 3, 2022
edited
Loading

Choose a reason for hiding this comment

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

It is a good point. I think for now we can rely on done being always called, why:

  • We are using a polyfill(https://canjs.com/doc/can-ndjson-stream.html) because Firefox does not support some stream APIs
  • I took a look and I didn't find anything related to "read failure" or something related
  • If an error is thrown, it will stop the execution anyway
  • This error, in particular, looks tricky to handle so I would expect someone having issues with that to think of a proper solution
  • In summary, I don't know how to do that and it looks complex to handle 😆, so I would not invest too much time on that right now, but if you have an idea how to solve that, I would love to learn and implement it for sure.

Kira-Pilot reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Ha! Thanks for the breakdown - what you said makes sense and I think you're right to hold off. If this becomes an issue in the future, we can look intocallingcancel on the ReadableStream object.

BrunoQuaresma reacted with thumbs up emoji
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Ahh, nice!

const { value, done } = await reader.read()

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp