Skip to content

Commit

Permalink
Make job locking work with multisite
Browse files Browse the repository at this point in the history
Fixes #849.
  • Loading branch information
utchy authored and john-shaffer committed Feb 18, 2022
1 parent 8ed46aa commit 00582cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [#805](https://github.com/leonstafford/wp2static/issues/805): Fix warning on cache page when there are no deployment namespaces @john-shaffer
- [#843](https://github.com/leonstafford/wp2static/issues/843): Always fire post-deployment action from the CLI, matching the normal behavior @michaelfig
- [#848](https://github.com/leonstafford/wp2static/issues/848): Fix error from IF EXISTS syntax when the db user can't see the schema. @utchy
- [#849](https://github.com/leonstafford/wp2static/issues/849): Make job locking work with multisite. @utchy

## WP2Static 7.1.7 (2021-09-04)

Expand Down
2 changes: 1 addition & 1 deletion src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public static function wp2staticProcessQueue() : void {
$jobs = JobQueue::getProcessableJobs();

foreach ( $jobs as $job ) {
$lock = 'wp2static_jobs.' . $job->job_type;
$lock = $wpdb->prefix . '.wp2static_jobs.' . $job->job_type;
$query = "SELECT GET_LOCK('$lock', 30) AS lck";
$locked = intval( $wpdb->get_row( $query )->lck );
if ( ! $locked ) {
Expand Down
2 changes: 1 addition & 1 deletion src/JobQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static function markFailedJobs() : void {

foreach ( $job_types as $type ) {
try {
$lock = "wp2static_jobs.$type";
$lock = "{$wpdb->prefix}.wp2static_jobs.$type";
$query = "SELECT IS_FREE_LOCK('$lock') AS free";
$free = intval( $wpdb->get_row( $query )->free );

Expand Down

0 comments on commit 00582cf

Please sign in to comment.