question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I run a job at a specific time once a day every week?

See original GitHub issue

Hello, I’m interesting in a periodic job (once a week for example) that is fired at a specific time (for example at 4.00 PM) I have read from this post

https://github.com/evernote/android-job/blob/master/FAQ.md#how-can-i-run-a-job-at-a-specific-time-once-a-day

that I can run a job every day once a day, but it is not my case. If I set

new JobRequest.Builder( MY_TAG )`
    .setExact( TimeUnit.HOURS.toMillis( 16 ) +  TimeUnit.MINUTES.toMillis( 0 ))
    .setPeriodic( TimeUnit.DAYS.toMillis( 7 ), TimeUnit.MINUTES.toMillis(5) )
    .setPersisted(true)
    .build()
    .schedule();

I have this error “Can’t call setExact() on a periodic job”

Can someone help me?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14

github_iconTop GitHub Comments

50reactions
vRallevcommented, Jun 12, 2017

I really don’t want to answer that here. That’s an issue tracker where people can report defects in the library. I suggest that you take a look at this sample and if that doesn’t help, then ask this question at an appropriate place like Stackoverflow.

1reaction
alifhasnaincommented, Sep 30, 2019

@hoangtrungnguyen Yeah I have solved my problem. I am using WorkManager now. I created a PeriodicWorkRequest and enqueued it as Unique Work so I only have one work running with a unique id. It periodically checks data from local database and fire the task with AlarmManager at an exact time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run a job on specific times every day from Monday to ...
One way is to create four jobs scheduled at a single time every Mon-Fri. Give each a single step, which is a job...
Read more >
Scheduling Jobs to Run at a Specific Time - IBM
The Submit Job (SBMJOB) command is an easy way to schedule a job that needs to run only once. It also enables the...
Read more >
5 Daily Scheduling Methods to Bring More Focus to Your Day
For example, you could schedule your most challenging tasks for the first two hours of the day and plow through your inbox during...
Read more >
How to run a cron job on specific days of the week
How to run a cron job on specific days of the week · 1. Edit the crontab for the user wishes to create...
Read more >
How to schedule a process to run in a specific time daily
Execution Target tab, select the Robot(s ) that you want to execute the process. · Specific Robots , all the Robots associated to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found