1
0
mirror of synced 2025-12-18 05:47:58 +08:00

🎨 移除joda-time依赖

Co-authored-by: hiz <liang@0318>
This commit is contained in:
Hiz
2021-03-10 11:20:06 +08:00
committed by GitHub
parent 30155b316b
commit 2736ea4edf
3 changed files with 15 additions and 13 deletions

View File

@@ -16,8 +16,8 @@ import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.joda.time.Instant;
import org.joda.time.Minutes;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -110,7 +110,7 @@ public class AutoUpdateCertificatesVerifier implements Verifier {
* 检查证书是否在有效期内,如果不在有效期内则进行更新
*/
private void checkAndAutoUpdateCert() {
if (instant == null || Minutes.minutesBetween(instant, Instant.now()).getMinutes() >= minutesInterval) {
if (instant == null || instant.plus(minutesInterval, ChronoUnit.MINUTES).compareTo(Instant.now()) >= 0) {
if (lock.tryLock()) {
try {
autoUpdateCert();