Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added possibility to skip an environement when purging #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/org/usf/inspect/server/PurgeScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void purgeBatch(){
inspectConfiguration.getConfig().getEnv().forEach((envName,depth) ->
{
envList.remove(envName);
purgeService.purgeData(List.of(envName), null, Instant.now().minus(depth, ChronoUnit.DAYS), null);
if(depth != -1){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'>-1'

purgeService.purgeData(List.of(envName), null, Instant.now().minus(depth, ChronoUnit.DAYS), null);
}
});
}
if(!envList.isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class PurgeService {

private final JdbcTemplate template;
private final Map<String, Integer> suppInfo = new HashMap<>();
private final Map<String, Integer> suppInfo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"purgeData' method variable !?


@Transactional(rollbackFor = Throwable.class)
public boolean purgeData(List<String> env, List<String> appName, Instant before, List<String> version) {
Expand All @@ -25,7 +25,7 @@ public boolean purgeData(List<String> env, List<String> appName, Instant before,
log.info("\t- Environment: " + env.toString());
log.info("\t- Start: " + before);
List<Query> queries = QueryLoader.loadQueries(env,appName,before,version);

suppInfo.clear();
int i;
for(Query query: queries){
if(query.getName()!= null && !query.getName().isEmpty()){
Expand Down
Loading