mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-28 04:51:01 +00:00
fix: add a check for minimum poll time
This commit is contained in:
@@ -15,6 +15,10 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
class AlarmManagerScheduler(private val context: Context) : TaskScheduler {
|
||||
override fun scheduleRepeatingTask(taskType: TaskType, interval: Long) {
|
||||
if (interval < TimeUnit.MINUTES.toMillis(15)) {
|
||||
cancelTask(taskType)
|
||||
return
|
||||
}
|
||||
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val intent = when (taskType) {
|
||||
TaskType.COMMENT_NOTIFICATION -> Intent(
|
||||
|
||||
Reference in New Issue
Block a user