Skip to content

Commit

Permalink
IMAP: Ensure our cron event is scheduled when auto-connect is enabled.
Browse files Browse the repository at this point in the history
Previously, our cron event was only scheduled when connecting to the IMAP
inbox on the initial connection.  However, if our IMAP connection ever
dies, our cron event is never rescheduled, so admins would never know if
the IMAP connection needs to be restarted or not.

This commit always checks to register our cron event to ensure admins can
restart the IMAP connection when needed.

See #40.
  • Loading branch information
r-a-y committed Jun 13, 2017
1 parent 17b4799 commit a8d4b4c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/bp-rbe-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
}

if ( bp_is_root_blog() && bp_rbe_get_setting( 'keepaliveauto' ) ) {
// Schedule hourly check.
if ( ! wp_next_scheduled ( 'bp_rbe_schedule' ) ) {
wp_schedule_event( time() + 60 * 60, 'hourly', 'bp_rbe_schedule' );
}

add_action( 'bp_rbe_schedule', 'bp_rbe_imap_down_email_notice' );
}

Expand Down

0 comments on commit a8d4b4c

Please sign in to comment.