Skip to content

Commit da013aa

Browse files
committed
Corrects edge-case to load existing config when remote is not available
1 parent c6bd5f7 commit da013aa

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/classes/QueueitKnownUser.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ public function getIntegrationConfig($ttl = 300, $json = TRUE) {
207207
return FALSE;
208208
}
209209
$last_pull = variable_get('queueit_last_pull', 0);
210+
$config_arr = variable_get('queueit_config', []);
211+
$config_json = json_encode($config_arr);
210212
if (REQUEST_TIME - $last_pull > $ttl) {
211213
// Get the auto-generated config file published on Queue-it Go platform.
212214
// URL: https://[your-customer-id].queue-it.net/status/integrationconfig/[your-customer-id]
@@ -219,10 +221,6 @@ public function getIntegrationConfig($ttl = 300, $json = TRUE) {
219221
variable_set('queueit_last_pull', REQUEST_TIME);
220222
}
221223
}
222-
else {
223-
$config_arr = variable_get('queueit_config', []);
224-
$config_json = json_encode($config_arr);
225-
}
226224
return $json ? $config_json : $config_arr;
227225
}
228226

0 commit comments

Comments
 (0)