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

feature: allow sync flag to be passed to ThreadStream for synchronous… #2063

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

karankraina
Copy link
Contributor

Allow sync flag to be passed to ThreadStream for sync logging.
Ref - #1801

@karankraina
Copy link
Contributor Author

@mcollina Do you think this works ?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Thanks for opening a PR! Can you please add a unit test?

@karankraina
Copy link
Contributor Author

@mcollina Added unit test.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

You might need to pass flush: true to https://nodejs.org/api/fs.html#filehandlecreatewritestreamoptions in

const stream = fs.createWriteStream(opts.destination)
. Otherwise Node.js would not fsync the file descriptor, so you might not be able to read it.

@karankraina
Copy link
Contributor Author

@mcollina Ah yess, updated PR. flush: true fixed it. Added loop duration by a bit just in case.

@karankraina
Copy link
Contributor Author

@mcollina Ah yess, updated PR. flush: true fixed it. Added loop duration by a bit just in case.

Ubuntu 22 failing for some reason. :( Need to re-check this. Had worked on my fork

@karankraina
Copy link
Contributor Author

@mcollina @kibertoad Good to merge now :)

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 5bc0a92 into pinojs:main Oct 15, 2024
12 checks passed
alexandresoro pushed a commit to alexandresoro/ouca that referenced this pull request Oct 16, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pino](https://getpino.io) ([source](https://github.com/pinojs/pino)) | dependencies | minor | [`9.4.0` -> `9.5.0`](https://renovatebot.com/diffs/npm/pino/9.4.0/9.5.0) |

---

### Release Notes

<details>
<summary>pinojs/pino (pino)</summary>

### [`v9.5.0`](https://github.com/pinojs/pino/releases/tag/v9.5.0)

[Compare Source](pinojs/pino@v9.4.0...v9.5.0)

#### What's Changed

-   build(deps-dev): bump [@&#8203;yao-pkg/pkg](https://github.com/yao-pkg/pkg) from 5.12.1 to 5.13.0 by [@&#8203;dependabot](https://github.com/dependabot) in pinojs/pino#2042
-   build(deps): bump pino-abstract-transport from 1.2.0 to 2.0.0 by [@&#8203;dependabot](https://github.com/dependabot) in pinojs/pino#2043
-   Update transports.md by [@&#8203;Jhon-Mosk](https://github.com/Jhon-Mosk) in pinojs/pino#2041
-   doc: Add Transport [@&#8203;macfja/pino-fingers-crossed](https://github.com/macfja/pino-fingers-crossed) by [@&#8203;MacFJA](https://github.com/MacFJA) in pinojs/pino#2047
-   build(deps-dev): bump [@&#8203;yao-pkg/pkg](https://github.com/yao-pkg/pkg) from 5.13.0 to 5.15.0 by [@&#8203;dependabot](https://github.com/dependabot) in pinojs/pino#2050
-   docs->added pino-hana transport by [@&#8203;HiImGiovi](https://github.com/HiImGiovi) in pinojs/pino#2059
-   docs -> [#&#8203;2061](pinojs/pino#2061) Alphabetize transport list and reorder sections in documentation by [@&#8203;superherobtf1985](https://github.com/superherobtf1985) in pinojs/pino#2062
-   feature: allow sync flag to be passed to ThreadStream for synchronous… by [@&#8203;karankraina](https://github.com/karankraina) in pinojs/pino#2063
-   fix: Ensure silent log level is respected with browser.transmit option by [@&#8203;SrsDanny](https://github.com/SrsDanny) in pinojs/pino#2052

#### New Contributors

-   [@&#8203;MacFJA](https://github.com/MacFJA) made their first contribution in pinojs/pino#2047
-   [@&#8203;HiImGiovi](https://github.com/HiImGiovi) made their first contribution in pinojs/pino#2059
-   [@&#8203;superherobtf1985](https://github.com/superherobtf1985) made their first contribution in pinojs/pino#2062
-   [@&#8203;karankraina](https://github.com/karankraina) made their first contribution in pinojs/pino#2063
-   [@&#8203;SrsDanny](https://github.com/SrsDanny) made their first contribution in pinojs/pino#2052

**Full Changelog**: pinojs/pino@v9.4.0...v9.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMjQuMCIsInVwZGF0ZWRJblZlciI6IjM4LjEyNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/226
Reviewed-by: Alexandre Soro <code@soro.dev>
Co-authored-by: renovate <renovate@git.tristess.app>
Co-committed-by: renovate <renovate@git.tristess.app>
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.

3 participants