Jump to content

Post media scan task gets cancelled


Recommended Posts

Posted

My plugin has a task that is executed after a media scan, the task is derived from ILibraryPostScanTask andit works fine, most of the time.

It checks if any analysis needs to be performed, and if not, doesnt perform them.


However if the analysis is necessary, it can take a minute or two.

Sometimes, while its running in the post media scan, I will see in the log the following:
2026-10-09 11:14:38.504 Info TaskManager: Attempting to cancel Scheduled Task Scan media library
2026-10-09 11:14:38.504 Info TaskManager: Queueing task RefreshMediaLibraryTask

The task running (from my plugin) will finish, then any others are blocked from running.
Then another scan is kicked off.

Typically All goes well the second run of the scan media.

Any thoughts?

emberserver.txt

Posted

If a new library scan is started while one is running, then the current scan is cancelled.

Posted
55 minutes ago, Luke said:

If a new library scan is started while one is running, then the current scan is cancelled.

How are "post scan" tasks cancelled?  It looks like it simply blocks any from continuing.

I dont know if it is possible, but it would be great if the CancelToken could be triggered.

Posted
26 minutes ago, Luke said:

the cancellation token.

Yes

HawkXP71
Posted
On 10/9/2026 at 11:44 AM, Luke said:

If a new library scan is started while one is running, then the current scan is cancelled.

Is there any way to delay or make the delay longer?  meaning allow the scan to continue ?

Posted

What delay? Just don’t start another scan.

HawkXP71
Posted
16 hours ago, Luke said:

What delay? Just don’t start another scan.

I am not kicking off the scan, something in the system is.

HawkXP71
Posted

Is there any "switch" (I have tried debug logging to no avail) that reports to the log "why" a scan has been kicked off?

Not sure why, but even without my plugins "extra work" Im noticing a bunch of "canceled scan", then the "attempting to cancel" and finally a restart of the scan.

But there is no information given (did the smart watched library kick it off, or did I click a button or something)?

TIA

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...