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 <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
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