Code Monkey home page Code Monkey logo

Comments (8)

stefoid avatar stefoid commented on August 15, 2024

Logically, if the jobManager isnt running, and stop was never called, then it must not have been started correctly. But looking at the constructor. running=true is set very early.
I cant work it out.

from android-priority-jobqueue.

stefoid avatar stefoid commented on August 15, 2024

Is there an underlying problem with starting a lot of JobManagers, do you think?

from android-priority-jobqueue.

kingargyle avatar kingargyle commented on August 15, 2024

Make sure you always call jobManager.start() this will guarantee that the particular jobmanager is running.

from android-priority-jobqueue.

stefoid avatar stefoid commented on August 15, 2024

Hi. Is this a known issue?
I saw a stack overflow 'issue' that said something about making lots of JobManagers with persistant queues - maybe hitting up the underlying sqlite layer with multiple jobmanagers at creation time causes some kind of failure? Im just guessing: What Ive done to try to avoid this is:

  1. reduced the number of job managers being created by using groupIds.
  2. made sure Im using different jobmanager ids.
  3. as only 1 of the JobManagers actually needs persistant jobs, I passed in a custom JobQueue factory that returned non-persistant queues for both types of queue

As of doing that I havent seen the problem again, but obviously with these sorts of itermittant values, thats no guarentee. Ill update this thread if it happens again.

from android-priority-jobqueue.

stefoid avatar stefoid commented on August 15, 2024

BTW, Ive also hit problems with very big jobs - first of all the android cursor explodes at 1 or 2MB, and then getting around that issue with a custom persistent queue then explodes the deserializaiton.

So I gave up and stored the large part of the job in a file.

from android-priority-jobqueue.

yigit avatar yigit commented on August 15, 2024

@stefoid Are you providing an ID to your jobs ? Or at least you should if they are decoupled (otherwise use 1 job manager). Also, there are no internal calls to stop so i'm not sure how it is happening either. Do you have a test app that i can look at ? (btw, sorry about the late reply, i just came back from a long vacation)

from android-priority-jobqueue.

stefoid avatar stefoid commented on August 15, 2024

Hi. Our problem seems to have gone. What we were doing was creating lots of JobManagers for various duties, most of which did not need persistent Jobs, so we didnt create them with an Id.

What we are doing now is passing the same non-persistent job queue to both createPersistentJobQueue as well as nonPersistent, so we dont involve slqite when we dont need to.

And we have consolidated a lot of JobManagers and are using group ids instead.

What I believe was happening (didnt see/capture it happening as it was intermittent) was getting and invisibly swallowing some exception or other during JobManager creation while JobManager was trying to setup to Sqlite. Thats the only thing that makes sense - so every now and then we got back a JobManager that wasnt actually running.

A suggestion might be to more easily configure a non-persistent JobManager if you dont require that functionality, and make construction exceptions more visible in some way.

from android-priority-jobqueue.

yigit avatar yigit commented on August 15, 2024

To create a non-persistent job queue, you can provide a queue factory in the job configuration and just provide implementation of a queue that does nothing and always returns empty result. Glad issue is resolved, please re-submit if you can reproduce it.

from android-priority-jobqueue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.