Cancel pending sync on poll

This commit is contained in:
M66B 2021-03-05 17:43:05 +01:00
parent ae2cf963a6
commit 4353ab9020
3 changed files with 4 additions and 16 deletions

View File

@ -1658,8 +1658,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (!mapFolders.get(folder).isOpen())
throw new StoreClosedException(iservice.getStore(), "NOOP " + folder.name);
} else {
if (folder.poll_count == 0)
if (folder.poll_count == 0) {
// Cancel pending sync, for example when the folder is not set to poll
db.operation().deleteOperation(folder.id, EntityOperation.SYNC);
EntityOperation.sync(this, folder.id, false);
}
folder.poll_count = (folder.poll_count + 1) % folder.poll_factor;
db.folder().setFolderPollCount(folder.id, folder.poll_count);
Log.i(folder.name + " poll count=" + folder.poll_count);

View File

@ -1,15 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M14.07,15.23c0.12,-0.39 0.18,-0.8 0.18,-1.23c0,-0.43 -0.06,-0.84 -0.18,-1.23l1.49,-1.13l-0.73,-1.27l-1.73,0.73c-0.56,-0.6 -1.3,-1.04 -2.13,-1.23L10.73,8H9.27L9.03,9.86c-0.83,0.19 -1.57,0.63 -2.13,1.23l-1.73,-0.73l-0.73,1.27l1.49,1.13c-0.12,0.39 -0.18,0.8 -0.18,1.23c0,0.43 0.06,0.84 0.18,1.23l-1.49,1.13l0.73,1.27l1.73,-0.73c0.56,0.6 1.3,1.04 2.13,1.23L9.27,20h1.47l0.23,-1.86c0.83,-0.19 1.57,-0.63 2.13,-1.23l1.73,0.73l0.73,-1.27L14.07,15.23zM10,17c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3s3,1.34 3,3S11.66,17 10,17z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M10,13c0.55,0 1,0.45 1,1s-0.45,1 -1,1s-1,-0.45 -1,-1S9.45,13 10,13M10,11c-1.66,0 -3,1.34 -3,3s1.34,3 3,3s3,-1.34 3,-3S11.66,11 10,11L10,11zM18.5,9l1.09,-2.41L22,5.5l-2.41,-1.09L18.5,2l-1.09,2.41L15,5.5l2.41,1.09L18.5,9zM21.28,12.72L20.5,11l-0.78,1.72L18,13.5l1.72,0.78L20.5,16l0.78,-1.72L23,13.5L21.28,12.72zM16.25,14c0,-0.12 0,-0.25 -0.01,-0.37l1.94,-1.47l-2.5,-4.33l-2.24,0.94c-0.2,-0.13 -0.42,-0.26 -0.64,-0.37L12.5,6h-5L7.2,8.41C6.98,8.52 6.77,8.65 6.56,8.78L4.32,7.83l-2.5,4.33l1.94,1.47C3.75,13.75 3.75,13.88 3.75,14s0,0.25 0.01,0.37l-1.94,1.47l2.5,4.33l2.24,-0.94c0.2,0.13 0.42,0.26 0.64,0.37L7.5,22h5l0.3,-2.41c0.22,-0.11 0.43,-0.23 0.64,-0.37l2.24,0.94l2.5,-4.33l-1.94,-1.47C16.25,14.25 16.25,14.12 16.25,14zM14.83,17.64l-1.73,-0.73c-0.56,0.6 -1.3,1.04 -2.13,1.23L10.73,20H9.27l-0.23,-1.86c-0.83,-0.19 -1.57,-0.63 -2.13,-1.23l-1.73,0.73l-0.73,-1.27l1.49,-1.13c-0.12,-0.39 -0.18,-0.8 -0.18,-1.23c0,-0.43 0.06,-0.84 0.18,-1.23l-1.49,-1.13l0.73,-1.27l1.73,0.73c0.56,-0.6 1.3,-1.04 2.13,-1.23L9.27,8h1.47l0.23,1.86c0.83,0.19 1.57,0.63 2.13,1.23l1.73,-0.73l0.73,1.27l-1.49,1.13c0.12,0.39 0.18,0.8 0.18,1.23c0,0.43 -0.06,0.84 -0.18,1.23l1.49,1.13L14.83,17.64z"/>
</vector>