Merge branch 'main' of github.com:dataease/dataease into main

This commit is contained in:
taojinlong
2021-06-11 16:47:54 +08:00
7 changed files with 38 additions and 24 deletions

View File

@@ -74,9 +74,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);
Date nTimeByCron = getNTimeByCron(cron, startTime);
if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron);
}
// if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron);
// }
if (endTime != null) {
if (endTime.before(nTimeByCron)) {
@@ -157,9 +157,9 @@ public class ScheduleManager {
triggerBuilder.withIdentity(triggerKey);// 触发器名,触发器组
Date nTimeByCron = getNTimeByCron(cron, startTime);
if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron);
}
// if (startTime.before(new Date())) {
triggerBuilder.startAt(nTimeByCron);
// }
if (endTime != null) {
if (endTime.before(nTimeByCron)) {

View File

@@ -4,6 +4,7 @@ import io.dataease.commons.constants.AuthConstants;
import io.dataease.commons.license.DefaultLicenseService;
import io.dataease.commons.license.F2CLicenseResponse;
import io.dataease.commons.utils.CommonBeanFactory;
import io.dataease.commons.utils.DateUtils;
import io.dataease.commons.utils.LogUtil;
import io.dataease.listener.util.CacheUtils;
import org.apache.commons.io.FileUtils;
@@ -27,11 +28,17 @@ public class AboutService {
F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey);
Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> {
if (resp.getStatus() == F2CLicenseResponse.Status.valid){
CacheUtils.updateLicCache(new Date(f2CLicenseResponse.getLicense().getExpired()));
CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
String dateStr = f2CLicenseResponse.getLicense().getExpired();
LogUtil.info("update valid lic, expired date is {}", dateStr);
try {
Date date = DateUtils.getDate(dateStr);
CacheUtils.updateLicCache(date);
CacheUtils.removeAll(AuthConstants.USER_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
} catch (Exception e) {
LogUtil.error(e);
}
}
});
return f2CLicenseResponse;