-
-
Notifications
You must be signed in to change notification settings - Fork 61
feat(client):support single instance #522
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
base: master
Are you sure you want to change the base?
Conversation
Pending testing :) |
a7e3049
to
cea060e
Compare
Did some testing on linux, works as expected. Will do windows later |
c83ef58
to
69d72b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 69d72b6 in 1 minute and 48 seconds
More details
- Looked at
320
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. aw-client-rust/src/single_instance.rs:27
- Draft comment:
Consider propagating the original io::Error for create_dir_all instead of mapping to a generic LockDirCreation error to provide more context. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
2. aw-client-rust/src/single_instance.rs:76
- Draft comment:
The Drop implementation manually drops the file by taking it and updating the atomic flag. Consider whether an explicit unlock (if available via the trait) would be more idiomatic, though dropping the file handle typically releases the lock. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
3. aw-client-rust/Cargo.toml:25
- Draft comment:
Consider specifying an explicit version for 'tokio-test' instead of using "*" to ensure reproducible builds. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. aw-client-rust/src/lib.rs:36
- Draft comment:
For idiomatic Rust, consider removing the explicit 'return' inget_hostname
. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
5. aw-client-rust/src/lib.rs:225
- Draft comment:
Instead of panicking on parse failure in get_event_count, consider propagating an error. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. aw-client-rust/src/lib.rs:235
- Draft comment:
Consider making 'wait_for_start' async to avoid blocking the async runtime. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. aw-client-rust/src/single_instance.rs:77
- Draft comment:
Optionally, explicitly unlock the file (if supported) before dropping for clarity, rather than solely relying on dropping the file handle. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
8. aw-client-rust/Cargo.toml:17
- Draft comment:
Minor style note: The line forthiserror = "1.0"
has trailing whitespace. For consistency with other lines, please remove the extra space at the end. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
While the comment is technically correct about the trailing whitespace, this is an extremely minor formatting issue that doesn't affect functionality. Most IDEs automatically handle whitespace, and this kind of nitpick creates unnecessary noise in the PR review. The rules specifically say not to make comments that are obvious or unimportant.
The trailing whitespace could theoretically cause issues with some tools or scripts that are sensitive to whitespace. Some teams might have strict formatting requirements.
Even if whitespace is important to the team, this is too minor to warrant a PR comment. If whitespace is critical, it should be handled by automated formatting tools or pre-commit hooks, not manual review comments.
Delete this comment as it violates the rule about not making obvious or unimportant comments. Trailing whitespace in a Cargo.toml file is too minor to warrant a review comment.
Workflow ID: wflow_dt91vxoiTGabzSP4
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
69d72b6
to
7d30abe
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #522 +/- ##
==========================================
- Coverage 70.81% 70.29% -0.53%
==========================================
Files 51 52 +1
Lines 2916 2962 +46
==========================================
+ Hits 2065 2082 +17
- Misses 851 880 +29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Important
Add
SingleInstance
struct to ensure only one client instance runs at a time, with necessary dependencies and integration intoAwClient
.SingleInstance
struct insingle_instance.rs
to ensure only one instance of the client runs at a time using file-based locking.SingleInstance
intoAwClient
inlib.rs
by adding asingle_instance
field and initializing it inAwClient::new()
.dirs
,fs4
,libc
,log
, andthiserror
toCargo.toml
for handling file paths, file locking, logging, and error handling.Cargo.lock
to reflect new and updated dependencies.This description was created by
for 69d72b6. It will automatically update as commits are pushed.