Skip to content

Commit

Permalink
Fixed issue with scheduling message retention cleanup #mam-76
Browse files Browse the repository at this point in the history
  • Loading branch information
hantu85 committed Sep 9, 2022
1 parent c8cb36c commit da4359a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/tigase/archive/MessageArchiveComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ public class MessageArchiveComponent

private static final String TAGS_SUPPORT_PROP_KEY = "tags-support";
private static final String REMOVE_EXPIRED_MESSAGES_KEY = "remove-expired-messages";
private static final String REMOVE_EXPIRED_MESSAGES_FIELD = "removeExpiredMessages";
private static final String REMOVE_EXPIRED_MESSAGES_DELAY_KEY = "remove-expired-messages-delay";
private static final String REMOVE_EXPIRED_MESSAGES_DELAY_FIELD = "removeExpiredMessagesDelay";
private static final String REMOVE_EXPIRED_MESSAGES_PERIOD_KEY = "remove-expired-messages-period";
private static final String REMOVE_EXPIRED_MESSAGES_PERIOD_FIELD = "removeExpiredMessagesPeriod";

//~--- fields ---------------------------------------------------------------

Expand Down Expand Up @@ -161,9 +164,9 @@ public void onUserRemoved(UserRepository.UserRemovedEvent event) {
@Override
public void beanConfigurationChanged(Collection<String> changedFields) {
super.beanConfigurationChanged(changedFields);
if (changedFields.contains(REMOVE_EXPIRED_MESSAGES_KEY) ||
changedFields.contains(REMOVE_EXPIRED_MESSAGES_PERIOD_KEY) ||
changedFields.contains(REMOVE_EXPIRED_MESSAGES_DELAY_KEY)) {
if (changedFields.contains(REMOVE_EXPIRED_MESSAGES_FIELD) ||
changedFields.contains(REMOVE_EXPIRED_MESSAGES_PERIOD_FIELD) ||
changedFields.contains(REMOVE_EXPIRED_MESSAGES_DELAY_FIELD)) {
if (expiredMessagesRemovalTask != null) {
expiredMessagesRemovalTask.cancel();
expiredMessagesRemovalTask = null;
Expand Down

0 comments on commit da4359a

Please sign in to comment.