Skip to content

Commit

Permalink
タイムライン更新の次回実行が1時間以上先になる場合は異常値としてタイマーをリセットする
Browse files Browse the repository at this point in the history
  • Loading branch information
upsilon committed Nov 13, 2023
1 parent 7cb5a25 commit e6099ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
==== Unreleased
* CHG: タイムライン更新が停止する不具合が報告される件への暫定的な対処
- タイムライン更新に30秒以上掛かっている場合は完了を待機せず次のタイマーを開始させる
- タイムライン更新の次回実行が1時間以上先になる場合は異常値としてタイマーをリセットする
* FIX: 動画のサムネイル表示時に再生可能であることを示すアイコンが表示されない不具合を修正

==== Ver 3.7.1(2023/07/20)
Expand Down
19 changes: 18 additions & 1 deletion OpenTween/TimelineScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,26 @@ public void RefreshSchedule()
return; // TimerCallback 内で更新されるのでここは単に無視してよい

if (this.Enabled)
this.timer.Change(this.NextTimerDelay(), Timeout.InfiniteTimeSpan);
{
var delay = this.NextTimerDelay();

// タイマーの待機時間が 1 時間を超える値になった場合は異常値として強制的にリセットする
// (タイムライン更新が停止する不具合が報告される件への暫定的な対処)
if (delay >= TimeSpan.FromHours(1))
{
MyCommon.ExceptionOut(new Exception("タイムライン更新の待機時間が異常値のためリセットします: " + delay));
foreach (var key in this.LastUpdatedAt.Keys)
this.LastUpdatedAt[key] = DateTimeUtc.MinValue;

delay = TimeSpan.FromSeconds(10);
}

this.timer.Change(delay, Timeout.InfiniteTimeSpan);
}
else
{
this.timer.Change(Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan);
}
}

public void SystemResumed()
Expand Down

0 comments on commit e6099ad

Please sign in to comment.