Skip to content

Commit

Permalink
Add duplicate ZEIR ID cleanup job
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Jan 13, 2023
1 parent 09130dc commit 3705d37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opensrp-unicef-tunisia/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ dependencies {
exclude group: 'com.ibm.fhir', module: 'fhir-path'
}

implementation('org.smartregister:opensrp-client-core:4.3.24-BETA-2-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-core:5.0.13-LOCAL-SNAPSHOT@aar') {
transitive = true
exclude group: 'id.zelory', module: 'compressor'
exclude group: 'com.android.support', module: 'appcompat-v7'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AppCompatDelegate;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.evernote.android.job.JobManager;
import com.google.firebase.crashlytics.FirebaseCrashlytics;

Expand Down Expand Up @@ -73,6 +75,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;

import io.fabric.sdk.android.Fabric;
import timber.log.Timber;

public class UnicefTunisiaApplication extends DrishtiApplication implements TimeChangedBroadcastReceiver.OnTimeChangedListener, Application.ActivityLifecycleCallbacks {
Expand Down Expand Up @@ -220,6 +223,9 @@ public void onCreate() {
context = Context.getInstance();
registerActivityLifecycleCallbacks(this);

Fabric.with(this, new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build());
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG);

context.updateApplicationContext(getApplicationContext());
context.updateCommonFtsObject(createCommonFtsObject(context.applicationContext()));

Expand Down Expand Up @@ -247,8 +253,6 @@ public void onCreate() {
ReportingLibrary.init(context, getRepository(), null, BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION);
ReportingLibrary.getInstance().addMultiResultProcessor(new ReportIndicatorsProcessor());

FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG);

initRepositories();

SyncStatusBroadcastReceiver.init(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.smartregister.growthmonitoring.job.WeightIntentServiceJob;
import org.smartregister.growthmonitoring.job.ZScoreRefreshIntentServiceJob;
import org.smartregister.immunization.job.VaccineServiceJob;
import org.smartregister.job.DuplicateZeirIdsCleanerWorker;
import org.smartregister.job.ImageUploadServiceJob;
import org.smartregister.job.PullUniqueIdsServiceJob;
import org.smartregister.job.SyncAllLocationsServiceJob;
Expand Down Expand Up @@ -69,5 +70,12 @@ protected void scheduleJobsImmediately() {
ZScoreRefreshIntentServiceJob.scheduleJobImmediately(ZScoreRefreshIntentServiceJob.TAG);
ImageUploadServiceJob.scheduleJobImmediately(ImageUploadServiceJob.TAG);
ArchiveClientsJob.scheduleJobImmediately(ArchiveClientsJob.TAG);
/*
This job will not be duplicated but is added here since scheduleJobsPeriodically is only called
after a remote login and therefore might be run too late. scheduleJobsImmediately is called
after both remote login and local login
*/
String[] eventTypes = new String[]{"Father Registration"};
DuplicateZeirIdsCleanerWorker.schedulePeriodically(getApplicationContext(), 15, eventTypes);
}
}

0 comments on commit 3705d37

Please sign in to comment.