java - Muzei plugin getting stuck in state where it will never get an onUpdate() call -


i've written muzei plugin uses flickr api check , fetch remote image once hour. i've noticed app in bad state , stop updating. i've checked shared prefs (where muzei stores next update time) , i've noticed scheduled_update_time_millis variable no longer present in art source xml file.

i've double checked remotemuzeiartsource.ontryupdate() method call , i've verified should either call

long check_interval_millis = 1 * 60 * 60 * 1000l; // 1 hr scheduleupdate(system.currenttimemillis() + check_interval_millis); 

or throw retryexception

i'm unable consistently repro getting bad state unfortunately, i'm not sure how happens.

full source remotemuzeiartsource class lives here: cactusartsource

answering own question: turns out runtimeexception thrown during execution of ontryupdate or onupdate result unsurprisingly in not getting through entire method , (in case) not scheduling new update. in case, retrofiterror being thrown during bad network event. threw little try-catch handling @ , seems have fixed error


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -