package com.avg.zaap.crashlibrary.offline.uploader;

import com.avg.zaap.crashlibrary.CrashLib;

import java.util.Calendar;

/**
 * This class serves as the default delay helper.
 * <p/>
 * Created by marek.osvald on 6.9.2016.
 */
public class DelayHelper implements IDelayHelper {

    @Override
    public boolean isAttemptValid(long lastAttemptTimestamp) {
        long currentTimestamp = Calendar.getInstance().getTimeInMillis();
        long delay = CrashLib.getConfig().getDelay();

        return lastAttemptTimestamp + delay <= currentTimestamp;
    }

}
