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

fix: load compose logs async not await #3377

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

cdrage
Copy link
Contributor

@cdrage cdrage commented Jul 31, 2023

fix: load compose logs async not await

What does this PR do?

  • Loads all the compose containers asynchronously rather than using await.
  • Adds simple tests for No logs, however, will have to add integration
    test for loading logs correcctly

Screenshot/screencast of this PR

Screen.Recording.2023-07-31.at.12.03.03.PM.mov

What issues does this PR fix or reference?

Closes #3349

How to test this PR?

  1. Test using Docker Compose example: https://gist.githubusercontent.com/benoitf/a94cff3545cb0992007dd1fc58287816/raw/d0b33311834d84ec1d6830b32a167af80c84926e/docker-compose-example.yaml
  2. Compose logs will appear asynchronously now / while podman desktop
    retrieves the logs, rather than await for each container

Signed-off-by: Charlie Drage charlie@charliedrage.com

@cdrage cdrage requested review from a team and benoitf as code owners July 31, 2023 16:08
@cdrage cdrage requested review from lstocchi and removed request for a team July 31, 2023 16:08
await window.logsContainer(container.engineId, container.id, logsCallback);
// Get the logs for the container asynchronously / all at the same time
// this will update the terminal as the logs come in.
window.logsContainer(container.engineId, container.id, logsCallback);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there is a missing catch here
( I think an eslint rule is still not applied but it would fail)

Copy link
Collaborator

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

it requires promise.catch(your code) not try { } catch

@cdrage cdrage force-pushed the load-logs-async branch 2 times, most recently from 16ae392 to 6f5b0cf Compare August 1, 2023 18:12
### What does this PR do?

* Loads all the compose containers asynchronously rather than using await.
* Adds simple tests for No logs, however, will have to add integration
  test for loading logs correcctly

### Screenshot/screencast of this PR

<!-- Please include a screenshot or a screencast explaining what is doing this PR -->

### What issues does this PR fix or reference?

<!-- Please include any related issue from Podman Desktop repository (or from another issue tracker).
-->

Closes containers#3349

### How to test this PR?

<!-- Please explain steps to reproduce -->

1. Test using Docker Compose example: https://gist.githubusercontent.com/benoitf/a94cff3545cb0992007dd1fc58287816/raw/d0b33311834d84ec1d6830b32a167af80c84926e/docker-compose-example.yaml
2. Compose logs will appear asynchronously now / while podman desktop
   retrieves the logs, rather than await for each container

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Copy link
Collaborator

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

image

@cdrage cdrage merged commit d4c4f05 into containers:main Aug 2, 2023
8 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.3.0 milestone Aug 2, 2023
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.

no logs for compose group
3 participants