From 81f5dd7774119e6f35f4594a68b25e53a22e65f2 Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 9 Nov 2011 13:40:23 +0000 Subject: Consider replication delays in session storage --- program/steps/mail/compose.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'program/steps') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 6961bf86a..c527ce15f 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -31,6 +31,14 @@ $MESSAGE = NULL; $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; +// give replicated session storage some time to synchronize +$retries = 0; +while ($COMPOSE_ID && !is_array($_SESSION['compose']) && $RCMAIL->db->is_replicated() && $retries++ < 5) { + usleep(500000); + $RCMAIL->session->reload(); + $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; +} + // Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or // if a compose-ID is given (i.e. when the compose step is opened in a new window/tab). if (!is_array($_SESSION['compose'])) -- cgit v1.2.3