// <-- TODO: why is this here? public void ChangeTrackerStopped(ChangeTracker tracker) { Log.W(Tag, this + ": ChangeTracker " + tracker + " stopped"); if (LastError == null && tracker.GetLastError() != null) { LastError = tracker.GetLastError(); } changeTracker = null; if (Batcher != null) { Log.D(Tag, this + ": calling batcher.flush(). batcher.count() is " + Batcher.Count()); Batcher.Flush(); } if (!Continuous) { var t = Task.Factory.StartNew(() => { Task inner = Task.Factory.StartNew(() => {}); return(inner); }); WorkExecutor.StartNew(() => { AsyncTaskFinished(1); }); } }
public void ChangeTrackerStopped(ChangeTracker tracker) { Log.W(Log.TagSync, "%s: ChangeTracker %s stopped", this, tracker); if (error == null && tracker.GetLastError() != null) { SetError(tracker.GetLastError()); } changeTracker = null; if (batcher != null) { Log.D(Log.TagSync, "%s: calling batcher.flush(). batcher.count() is %d", this, batcher .Count()); batcher.Flush(); } if (!IsContinuous()) { // the asyncTaskFinished needs to run on the work executor // in order to fix https://github.com/couchbase/couchbase-lite-java-core/issues/91 // basically, bad things happen when this runs on ChangeTracker thread. workExecutor.Submit(new _Runnable_239(this)); } }
public void ChangeTrackerStopped(ChangeTracker tracker) { Log.W(Database.Tag, this + ": ChangeTracker " + tracker + " stopped"); if (error == null && tracker.GetLastError() != null) { SetError(tracker.GetLastError()); } changeTracker = null; if (batcher != null) { Log.D(Database.Tag, this + ": calling batcher.flush(). batcher.count() is " + batcher .Count()); batcher.Flush(); } if (!IsContinuous()) { Log.D(Database.Tag, this + "|" + Sharpen.Thread.CurrentThread() + ": changeTrackerStopped() calling asyncTaskFinished()" ); // the asyncTaskFinished needs to run on the work executor // in order to fix https://github.com/couchbase/couchbase-lite-java-core/issues/91 // basically, bad things happen when this runs on ChangeTracker thread. workExecutor.Submit(new _Runnable_207(this)); } }