daily job not working
See original GitHub issueI use daily job scheduler just like the sample in faq page
'class DailyJobSchedule : DailyJob() {
@RequiresApi(Build.VERSION_CODES.O)
override fun onRunDailyJob(params: Params): DailyJobResult {
callDb(Room.databaseBuilder(context, LogsDataBase::class.java, DATA_BASE_NAME).build()) {
it.observerElementDao().insertOrUpdate(Log(Date().time,"onRunDailyJob=${sdf.format(Date())}"))
}
return DailyJob.DailyJobResult.SUCCESS
}
companion object {
val TAG = "MyDailyJob"
fun schedule() {
DailyJob.schedule(
JobRequest.Builder(TAG)
.setRequiresDeviceIdle(true)
.setRequiredNetworkType(JobRequest.NetworkType.CONNECTED)
, TimeUnit.HOURS.toMillis(1), TimeUnit.HOURS.toMillis(6)
)
}
}
}
` but it does not run at all just when in next day I pick up the phone job called. the phone is asus_z017d android8 API 26 I know about doze mode I don’t think that’s the problem because in doze mode jobs starts with a delay but they start right?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
cron.daily jobs not running - Ask Ubuntu
There are two possible suspects that usually cause cron jobs not being able to run. The first is permissions problems, that is a...
Read more >I put a cronjob in /etc/cron.{hourly,daily,weekly,monthly} and it ...
I install cron job in /etc/cron.d/ but it does not work. Why is my cron job is not working, and how do I...
Read more >Why is my cron.daily script not running? - Pete Freitag
Cron scripts do not have all the same environment variables that you have when you are logged in to a shell, so the...
Read more >cron.daily not running automatically - Unix Stack Exchange
All jobs within /etc/cron. daily are not running automatically. I'm on Debian 10. All permissions and all file names are correct (filenames ...
Read more >The jobs in cron.daily are not executed by anacron or run-parts
Issue. We have a cron jobs in /etc/cron.daily which are expected to be executed once per day. The jobs in /etc/cron.daily didn't run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vRallev I have the exact same issue. I have scheduled multiple daily jobs using different job tags. These jobs will run and make a network call to fetch some data. Now there is a weird behavior in this case.
These jobs run perfectly when the app is in foreground but fails to make a network call when in background or killed state.
Now these failed daily jobs are accumulated and are fired when I launch my app.
Just to give a brief that I too have enforced network requirements.
**Also tried removing network requirements but no success at all. Works fine when the app is in foreground but fails if in background or killed state.
Closing because of inactivity.