Skip to content

Commit

Permalink
debugging debounced progress reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lg committed Oct 25, 2024
1 parent 593590b commit 05828b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Ui/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ module App =
let cacheFolder = Folder.GetPath Folders.cache
let dataStore = JsonFileDataStore cacheFolder
let youtube = Youtube(dataStore, VideoIndexRepository cacheFolder)
let dispatchProgress = Cmd.debounce 100 (fun progress -> SearchProgress progress)
command.SetProgressReporter(Progress<BatchProgress>(fun progress -> dispatchProgress progress |> List.iter (fun effect -> effect dispatch)))
let dispatchProgress = Cmd.debounce 100 (fun progress ->
System.Diagnostics.Debug.WriteLine("############# progress dispatched" + Environment.NewLine + progress.ToString())
SearchProgress progress)
command.SetProgressReporter(Progress<BatchProgress>(fun progress ->
System.Diagnostics.Debug.WriteLine("############# progress reported" + Environment.NewLine + progress.ToString())
dispatchProgress progress |> List.iter (fun effect -> effect dispatch)))
CommandValidator.PrevalidateSearchCommand command
use cts = new CancellationTokenSource()
do! CommandValidator.ValidateScopesAsync(command, youtube, dataStore, cts.Token) |> Async.AwaitTask
Expand Down

0 comments on commit 05828b6

Please sign in to comment.