fix(analysis): record nothing over photos another Titano changed in a shared sidecar
An analysis compared only this host's index row with the frames version it read at its start. On a desktop sharing a server's archive, the server's upload bumps only the shared sidecar until the desktop's next scan, and a desktop scan clears nothing. A desktop pass that recorded in that window wrote Auto values and statuses for the old frame count over the server's analysis in the shared project.json and sidecar, and nothing analysed the photos again. Under the sequence lock the analyser now reads the sidecar first. When its frames version is not the row's, the photos changed in another process and this index does not hold them yet: the pass records nothing, logs Advisor.Log.FramesChangedElsewhere and queues nothing, since a light analysis here would read the same index. The process that changed them analyses them, and this host's next scan indexes them (a server's scan then queues their analysis). A moved row still queues a light analysis unless one is queued, in which case the pass records as before. Tests cover the shared-archive case with a second index and engine, and the queued-light escape on a one-worker engine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
5 files changed
+158
-26
No files matched your search
@@ -44,7 +44,7 @@ internal sealed class AnalyseJobHandler(TitanoDatabase db, SequenceAnalyser anal
|
||||
var outcome = await analyser.AnalyseAsync(targets[i], deep, progress, context.Cancellation).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
if (outcome is null) context.Log(Loc.L("Archive.Log.SequenceMissing", targets[i]));
|
||||
else if (outcome.FramesChanged) await AnalyseAgainAsync(context, outcome.Sequence).ConfigureAwait(false);
|
||||
else if (outcome.FramesChanged != FramesChange.None) await NotRecordedAsync(context, outcome).ConfigureAwait(false);
|
||||
else Report(context, outcome, deep);
|
||||
}
|
||||
catch (Exception ex) when (ex is not (OperationCanceledException or ArchiveOfflineException))
|
||||
@@ -65,12 +65,19 @@ internal sealed class AnalyseJobHandler(TitanoDatabase db, SequenceAnalyser anal
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A sequence whose frames changed while it was analysed, with no light analysis queued for it: nothing was recorded
|
||||
/// from the frames the analysis read, so a light analysis of the frames as they are is queued (the deep report it saved
|
||||
/// counts only for the frames it describes).
|
||||
/// A sequence whose frames changed while it was analysed: nothing was recorded from the frames the analysis read (the
|
||||
/// deep report it saved counts only for the frames it describes). When this index holds the frames as they are, and no
|
||||
/// light analysis is queued for it, one is queued; frames another process changed are analysed by that process, and
|
||||
/// indexed here by the next scan (<see cref="FramesChange.NotIndexed"/>).
|
||||
/// </summary>
|
||||
private async Task AnalyseAgainAsync(JobContext context, Sequence sequence)
|
||||
private async Task NotRecordedAsync(JobContext context, AnalysisOutcome outcome)
|
||||
{
|
||||
var sequence = outcome.Sequence;
|
||||
if (outcome.FramesChanged == FramesChange.NotIndexed)
|
||||
{
|
||||
context.Log(Loc.L("Advisor.Log.FramesChangedElsewhere", sequence.DisplayTitle));
|
||||
return;
|
||||
}
|
||||
context.Log(Loc.L("Advisor.Log.FramesChanged", sequence.DisplayTitle));
|
||||
await AnalysisFollowUp.QueueAsync(db, context, [sequence.Id], sequence.DisplayTitle).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user