Skip to content

Commit

Permalink
revert changes to schedulerApiary
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza Jugon committed Nov 27, 2024
1 parent 5517c7f commit e66982e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.util.List;
import java.util.Optional;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -53,7 +51,7 @@ public SchedulerApiary(
@Transactional
public void scheduleBeekeeperEvent() {
Optional<BeekeeperEvent> housekeepingEntitiesToBeScheduled = beekeeperEventReader.read();
if (housekeepingEntitiesToBeScheduled.isEmpty()) {return;}
if (housekeepingEntitiesToBeScheduled.isEmpty()) { return; }
BeekeeperEvent beekeeperEvent = housekeepingEntitiesToBeScheduled.get();
List<HousekeepingEntity> housekeepingEntities = beekeeperEvent.getHousekeepingEntities();

Expand All @@ -65,13 +63,15 @@ public void scheduleBeekeeperEvent() {
} catch (Exception e) {
throw new BeekeeperException(format(
"Unable to schedule %s deletion for entity, this message will go back on the queue",
entity.getLifecycleType()), e);
entity.getLifecycleType()),
e);
}
}

beekeeperEventReader.delete(beekeeperEvent);
}

public void close() throws IOException {
beekeeperEventReader.close();
}
}
}

0 comments on commit e66982e

Please sign in to comment.