File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export default abstract class AbstractScrobbleClient extends AbstractComponent i
9494
9595 scrobbleDelay : number = 1000 ;
9696 scrobbleSleep : number = 2000 ;
97+ scrobbleWaitStopInterval : number = 2000 ;
9798 scrobbleRetries : number = 0 ;
9899 scrobbling : boolean = false ;
99100 userScrobblingStopSignal : undefined | any ;
@@ -626,11 +627,11 @@ export default abstract class AbstractScrobbleClient extends AbstractComponent i
626627 return ;
627628 }
628629 this . userScrobblingStopSignal = true ;
629- let secsPassed = 0 ;
630- while ( this . userScrobblingStopSignal !== undefined && secsPassed < 10 ) {
631- await sleep ( 2000 ) ;
632- secsPassed += 2 ;
633- this . logger . verbose ( `Waiting for scrobble processing stop signal to be acknowledged (waited ${ secsPassed } s )` ) ;
630+ let timePasssed = 0 ;
631+ while ( this . userScrobblingStopSignal !== undefined && timePasssed < ( this . scrobbleWaitStopInterval * 10 ) ) {
632+ await sleep ( this . scrobbleWaitStopInterval ) ;
633+ timePasssed += this . scrobbleWaitStopInterval ;
634+ this . logger . verbose ( `Waiting for scrobble processing stop signal to be acknowledged (waited ${ timePasssed } ms )` ) ;
634635 }
635636 if ( this . userScrobblingStopSignal !== undefined ) {
636637 this . logger . warn ( 'Could not stop scrobble processing! Or signal was lost :(' ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export class TestScrobbler extends AbstractScrobbleClient {
2121 this . getScrobblesForTimeRange = async ( _ ) => this . testRecentScrobbles ;
2222 this . scrobbleDelay = 10 ;
2323 this . scrobbleSleep = 20 ;
24+ this . scrobbleWaitStopInterval = 20 ;
2425 }
2526
2627 doScrobble ( playObj : PlayObject ) {
You can’t perform that action at this time.
0 commit comments