-
Notifications
You must be signed in to change notification settings - Fork 111
FYI: Migrate LogPeriodicDeleteService to DataMaintainanceBackgroundService #644
base: develop
Are you sure you want to change the base?
Conversation
70b5a35
to
6e2acc6
Compare
これ今のdevelopブランチともコンフリクトしてないのか 🤔 |
…rotate_workmanager
…rotate_workmanager
…rotate_workmanager
961c89e このあたりでiOSでバックグラウンドタスクが動かなくなったぞ! |
Adjust EarliestBeginDate from 24 hours later to 00:00 in UTC.
あ、これProcessをkillするとバックグラウンドタスクは動作しなくなるんだ(ExposureDetectionBackgroundServiceが特別)。 https://developer.apple.com/forums/thread/119758
|
なかなか実行されないなとConsoleでログを取ってみたら、実行の閾値を超えていない。アプリのインストール・アンインストールを繰り返しているせいかな…
ちなみにProcessing Tasksはアプリがフォアグラウンドにいるときは実行されないそうなので、テストの時は気をつけないといけない。 |
AppDelegateからScheduleするタイミングでは遅延無しで直ちに実行し、バックグラウンドプロセスの再スケジュール時に次の日を予定日時に設定するようにした。 まず初回の実行はうまくいっている。このまま明日の午前9時まで(!)様子を見る。
|
イベントログ送信は実行された。ログ消去(data-maintainance)はまだ。 試行はしてるので、そもそも登録されていないとかではなさそう。もしかして、同じアプリから実行される複数のProcessing Taskが同じ時間帯にリクエストされると、どちらか一方の実行が阻害(遅延)される?
|
data-maintainanceの実行を確認した。予定より4時間遅れ。
|
タスクを明示的にkillしてどうなるかを試してみた。 午前9時の実行予定タイミングに、今日は2つとも実行されるのを確認できた。 やったぜ。 cocoa_log_4b977711-2ab0-4327-850d-e230400b3d5c.zip
|
Android(WorkManager)でも問題なく動作していることを確認できました。 |
Issue 番号 / Issue ID
目的 / Purpose
破壊的変更をもたらしますか / Does this introduce a breaking change?
Pull Request の種類 / Pull Request type
検証方法 / How to test
コードの入手 / Get the code
コードの検証 / Test the code
確認事項 / What to check
iOS
タスクの登録成功を確認済み2022/06/26 12:48
"2022/06/26 12:48:01","Info","Start","ExecuteAsync","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar/Services/Migration/Initializer_1_0_0.cs","30","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/ExposureDetectionBackgroundService.cs","56","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Debug","BGTaskScheduler.Shared.Register succeeded.","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/ExposureDetectionBackgroundService.cs","93","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","Start","ScheduleBgTask","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/ExposureDetectionBackgroundService.cs","107","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","End","ScheduleBgTask","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/ExposureDetectionBackgroundService.cs","126","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","End","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/ExposureDetectionBackgroundService.cs","102","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/EventLogSubmissionBackgroundService.cs","37","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Debug","BGTaskScheduler.Shared.Register succeeded.","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/EventLogSubmissionBackgroundService.cs","76","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","Start","ScheduleBgTask","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/EventLogSubmissionBackgroundService.cs","90","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","End","ScheduleBgTask","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/EventLogSubmissionBackgroundService.cs","110","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","End","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/EventLogSubmissionBackgroundService.cs","85","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/DataMaintainanceBackgroundService.cs","49","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
"2022/06/26 12:48:01","Debug","BGTaskScheduler.Shared.Register succeeded.","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.iOS/Services/DataMaintainanceBackgroundService.cs","86","iOS","15.5","iPhone8,4","Physical","APP_VERSION","1.1"
タスクの実行成功を確認待ち
Android
タスクの登録成功を確認済み 2022/06/26 22:42
"2022/06/26 22:42:39","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/ExposureDetectionBackgroundService.cs","57","Android","12","Pixel 4","Physical","APP_VERSION","5"
"2022/06/26 22:42:39","Info","End","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/ExposureDetectionBackgroundService.cs","68","Android","12","Pixel 4","Physical","APP_VERSION","5"
"2022/06/26 22:42:39","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/EventLogSubmissionBackgroundService.cs","36","Android","12","Pixel 4","Physical","APP_VERSION","5"
"2022/06/26 22:42:39","Info","End","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/EventLogSubmissionBackgroundService.cs","47","Android","12","Pixel 4","Physical","APP_VERSION","5"
"2022/06/26 22:42:39","Info","Start","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/DataMaintainanceBackgroundService.cs","34","Android","12","Pixel 4","Physical","APP_VERSION","5"
"2022/06/26 22:42:39","Info","End","Schedule","/Users/keiji_ariyama/Projects/cocoa/Covid19Radar/Covid19Radar.Android/Services/DataMaintainanceBackgroundService.cs","45","Android","12","Pixel 4","Physical","APP_VERSION","5"
タスクの実行成功を確認待ち
その他 / Other information
BGAppRefreshTaskRequestはアプリにつき1つだけとのことなので、油断すると引っかかりそう。