Junjie
2026-04-27 91fbede5aa117b3c010e9cbb8804df90757dbe5c
src/main/java/com/zy/ai/service/impl/AutoTuneApplyServiceImpl.java
@@ -141,7 +141,7 @@
                        now,
                        true
                );
                refreshSystemConfigCacheIfNeeded(persistenceResult);
                refreshSystemConfigCacheSafely(persistenceResult);
                return buildResult(job, persistenceResult.getAuditChanges(), false);
            } catch (RuntimeException exception) {
                markWriteFailure(validatedChanges, exception);
@@ -216,7 +216,7 @@
                        sourceChanges,
                        now
                );
                refreshRollbackConfigCacheIfNeeded(persistenceResult);
                refreshRollbackConfigCacheSafely(persistenceResult);
                return buildResult(rollbackJob, persistenceResult.getRollbackChanges(), false);
            } catch (RuntimeException exception) {
                Date failureNow = new Date();
@@ -484,9 +484,9 @@
        }
    }
    private void refreshSystemConfigCacheIfNeeded(ApplyPersistenceResult persistenceResult) {
    private void refreshSystemConfigCacheSafely(ApplyPersistenceResult persistenceResult) {
        if (persistenceResult != null && persistenceResult.isRefreshConfigCache()) {
            configService.refreshSystemConfigCache();
            refreshSystemConfigCacheSafely("apply");
        }
    }
@@ -584,9 +584,17 @@
        return List.of(rollbackChange);
    }
    private void refreshRollbackConfigCacheIfNeeded(RollbackPersistenceResult persistenceResult) {
    private void refreshRollbackConfigCacheSafely(RollbackPersistenceResult persistenceResult) {
        if (persistenceResult != null && persistenceResult.isRefreshConfigCache()) {
            refreshSystemConfigCacheSafely("rollback");
        }
    }
    private void refreshSystemConfigCacheSafely(String scene) {
        try {
            configService.refreshSystemConfigCache();
        } catch (RuntimeException exception) {
            LOGGER.warn("AI自动调参{}已提交,但刷新系统配置缓存失败", scene, exception);
        }
    }