PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / trunk
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin vtrunk
1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 0.8.6 All 33 releases
desktop-mode / includes / storage-primary.php

storage-primary.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin trunk, at includes/storage-primary.php

28 lines 853 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Primary routing for storage operations that depend on current database state.
4 *
5 * @package OpenStation
6 */
7 defined( 'ABSPATH' ) || exit;
8
9 /**
10 * Keep advisory locks and their protected reads on writable connections.
11 *
12 * HyperDB classifies SELECT GET_LOCK and SELECT FOR UPDATE as reads. Use its
13 * supported routing API before acquiring the lock; LudicrousDB has a renamed
14 * equivalent. Keep this routing for the request so release and readbacks cannot
15 * move to a lagging replica. Standard wpdb already uses one connection.
16 *
17 * @internal
18 * @return void
19 */
20 function openstation_storage_use_primary() {
21 global $wpdb;
22 if ( is_callable( array( $wpdb, 'send_reads_to_primaries' ) ) ) {
23 $wpdb->send_reads_to_primaries();
24 } elseif ( is_callable( array( $wpdb, 'send_reads_to_masters' ) ) ) {
25 $wpdb->send_reads_to_masters();
26 }
27 }
28