Refactor: 학습 완료 후 레디스 제거

This commit is contained in:
김용수 2024-09-30 13:50:28 +09:00
parent 09cc8da47b
commit 0c57d36355
3 changed files with 9 additions and 0 deletions

View File

@ -98,6 +98,11 @@ public class ProgressCacheRepository {
.toList();
}
public void clearProgressModel(final int projectId, final int modelId) {
String key = CacheKey.trainKey(projectId, modelId);
redisTemplate.delete(key);
}
private ReportResponse convert(String data) {
return gson.fromJson(data, ReportResponse.class);
}

View File

@ -60,4 +60,7 @@ public class ProgressService {
return progressCacheRepository.getProgressModel(projectId, modelId);
}
public void clearProgress(final int projectId, final int modelId) {
progressCacheRepository.clearProgressModel(projectId, modelId);
}
}

View File

@ -62,5 +62,6 @@ public class ReportService {
reports.add(report);
}
reportRepository.saveAll(reports);
progressService.clearProgress(projectId, modelId);
}
}