Skip to content

Commit

Permalink
fix: notice spamming for No posts are available
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jul 16, 2024
1 parent e1af627 commit 4abd9b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/admin/models/class-rop-queue-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ public function get_queue() {
$post_pool = $this->selector->select( $account_id );

if ( empty( $post_pool ) ) {
$this->logger->alert_error( 'No posts are available to share for your account. Try activating the Share more than once option or changing the minimum and maximum post age setting to widen the pool of available posts.' );

$last_log_displayed = get_transient( 'rop_no_posts_log_displayed' );
$display_interval = 12 * HOUR_IN_SECONDS;
if ( ! $last_log_displayed || ( time() - $last_log_displayed ) > $display_interval ) {
$this->logger->alert_error( 'No posts are available to share for your account. Try activating the Share more than once option or changing the minimum and maximum post age setting to widen the pool of available posts.' );
set_transient( 'rop_no_posts_log_displayed', time(), $display_interval );
}
continue;
}

Expand Down

0 comments on commit 4abd9b7

Please sign in to comment.