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.

JobCreator get call with a tag on application start and without JobRequestBuilder

See original GitHub issue

Hi,

My application starts a periodic job under certain circumstances, like the user click on a periodic time to sync data from the UI. I found an issue, where the JobCreator is called with a tag and start a periodic job, but it shouldn’t.

//In the Application Class
JobManager.create(this).addJobCreator(MyJobCreator())
//My Creator
class MyJobCreator : JobCreator {
  override fun create(tag: String): Job? {
    Timber.d(">>>>>>>>>>>>>>>>>>>>>>>$tag") // TAG FOUND BUT SHOULDN'T
    return when (tag) {
        Constants.MY_JOB_TAG -> {
            Timber.d(">>>>>>>>>>>>>>>> MY JOB tag found!! WHY?????")
            MyJobService()
        }
        else -> null
    }
 }
}

The JobRequest.Builder(Constants.MY_JOB_TAG) is not called from the app, only when the user chose to start a schedule job.

I think that the issue comes from the Application class, where MyJobCreator is added.

Thx

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
vRallevcommented, May 30, 2018

There seems to be an issue in your logic. Not sure what I should do now.

0reactions
vRallevcommented, Jun 12, 2018

Please create a sample project at Github that I can easily checkout. I don’t have the time to setup everything manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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