-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make update check faster #249
base: main
Are you sure you want to change the base?
Conversation
sidekick_core/lib/sidekick_core.dart
Outdated
void Function()? updateCheck; | ||
try { | ||
final updateFuture = VersionChecker.isDependencyUpToDate( |
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.
The try catch is now useless, because the updateFuture
is not awaited.
The error of VersionChecker.isDependencyUpToDate()
is never caught and would crash the CLI
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.
The Future itself is awaited in Line 345 in combination with the timeout
Errors are caught and result in returning null
sidekick_core/lib/sidekick_core.dart
Outdated
@@ -284,8 +284,20 @@ class SidekickCommandRunner<T> extends CompletionCommandRunner<T> { | |||
final unmount = mount(debugName: args.join(' ')); | |||
|
|||
ArgResults? parsedArgs; | |||
Future<void Function()?>? updateCheck; |
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.
A Future<void>
should be sufficient. The void Function()
seems redundant
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.
I updated it to a String? :)
This PR is addressing this issue #174
Starting the update check at the beginning of a command in an isolate and execute the returned function, which contains the
_checkCliVersionIntegrity
and may contain the print that an update is available