PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.29
ووسلام – همگام سازی ووکامرس و باسلام v1.10.29
1.10.29 1.10.28 1.1.26 1.10.27 1.10.24 1.10.25 1.10.23 1.10.22 1.10.21 1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 All 62 releases
← All changes | JobManager.php +15 -0 1.1.26 → 1.10.29 View file →
@@ -110,8 +110,23 @@
110 110
111 111 return (string) $result === '1';
112 112 }
113 113
114 + public function getStaleProcessingJob(int $timeoutSeconds = 120): ?object
115 + {
116 + global $wpdb;
117 +
118 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, PluginCheck.Security.DirectDB.UnescapedDBParameter -- Custom queue table; identifier from the WordPress prefix, values prepared.
119 + return $wpdb->get_row($wpdb->prepare(
120 + "SELECT id, started_at FROM {$this->jobManagerTableName}
121 + WHERE status = 'processing'
122 + AND started_at IS NOT NULL
123 + AND started_at < %d
124 + ORDER BY started_at ASC, id ASC LIMIT 1",
125 + time() - $timeoutSeconds
126 + ));
127 + }
128 +
114 129 public function getJob($where = array())
115 130 {
116 131 global $wpdb;
117 132