fix: -collect mode now processes all posts instead of exiting after first
Changed CollectNotes from async void to async Task and await it with .GetAwaiter().GetResult() to match the pattern used by -replies and -likes. Previously the method would return immediately after the first await, causing Main to exit before the loop could process more than one post. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
@@ -244,7 +244,7 @@ namespace URLNotesGrabberCORE
|
||||
}
|
||||
}
|
||||
|
||||
CollectNotes(settings.GetValue<string>("PathOutput"), withoutNotesOnly, beforeDate);
|
||||
CollectNotes(settings.GetValue<string>("PathOutput"), withoutNotesOnly, beforeDate).GetAwaiter().GetResult();
|
||||
break;
|
||||
|
||||
case "-blogsR": //collect notes from all posts
|
||||
@@ -1073,7 +1073,7 @@ namespace URLNotesGrabberCORE
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
static async void CollectNotes(string outPath, bool withoutNotesOnly = true, DateTime? beforeDate = null)
|
||||
static async Task CollectNotes(string outPath, bool withoutNotesOnly = true, DateTime? beforeDate = null)
|
||||
{
|
||||
List<Tuple<string, long, long, long>> posts = DataAccess.GetPosts(withoutNotesOnly, beforeDate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user