Conversation
…ove abort handling
AlexisMora
reviewed
Feb 12, 2026
| signal?: AbortSignal, | ||
| ): Promise<void | null> => { | ||
| if (isCancelled && isCancelled()) { | ||
| if (signal?.aborted) { |
There was a problem hiding this comment.
Is it necessary to make the abortSignal optional? if its optional why have it in the first place?
Comment on lines
26
to
29
| currentScan = new ScanOrchestrator(); | ||
|
|
||
| await currentScan.scanPaths(paths); | ||
| currentScan = null; | ||
| await currentScan.scanPaths(paths); | ||
| currentScan = null; |
There was a problem hiding this comment.
Why it needs to be this way? seems odd you could do a helper function that handles this and make this function only call that,
| msg: 'Error in performScan:', | ||
| error, | ||
| }); | ||
| throw error; |
There was a problem hiding this comment.
Why do you need to catch an exception only to re-throw it again? doesnt make sense, maybe it is a better idea to wrap in trycatch the caller and let the caller handle said exception
| const currentScannedFile = await antivirus.scanFile(scannedItem.pathName); | ||
| const currentScannedFile = await antivirus.scanFile( | ||
| scannedItem.pathName, | ||
| backgroundScanAbortController!.signal, |
There was a problem hiding this comment.
Be careful with this, I would even try to find another way to do this only to avoid this expression
| } | ||
|
|
||
| const currentScannedFile = await antivirus.scanFile(scannedItem.pathName); | ||
| const currentScannedFile = await antivirus.scanFile(scannedItem.pathName, backgroundScanAbortController!.signal); |
| await getFilesFromDirectory(userSystemPath.path, (file: string) => backgroundQueue!.pushAsync(file)); | ||
| await getFilesFromDirectory( | ||
| userSystemPath.path, | ||
| (file: string) => backgroundQueue!.pushAsync(file), |
… usage in scan processes
…lesFromDirectory functions
…ualSystemScan test
|
AlexisMora
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What is Changed / Added
The scan cancellation method has been refactored to use an AbortController. Additionally, to prevent processes from continuing to run in the background, the daily scan is now canceled automatically when a custom scan is initiated.
Why
A user reported an issue where the daily scan continues running in the background and consuming resources even after initiating a custom scan.