Skip to content

Commit 0d3cdbb

Browse files
authored
Merge pull request #125 from cloudinary/hotfix/sync-status
Avoid key collision
2 parents 9bffb53 + 772e31c commit 0d3cdbb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-sync.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function is_synced( $post_id ) {
109109
return true;
110110
}
111111

112-
if ( apply_filters( 'cloudinary_flag_sync', '__return_false' ) ) {
112+
if ( apply_filters( 'cloudinary_flag_sync', '__return_false' ) && ! get_post_meta( $post_id, Sync::META_KEYS['downloading'], true ) ) {
113113
update_post_meta( $post_id, Sync::META_KEYS['syncing'], true );
114114
}
115115

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/media/class-upgrade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ function ( $val ) use ( $media ) {
165165

166166
// Flag the download
167167
update_post_meta( $attachment_id, Sync::META_KEYS['downloading'], true );
168+
delete_post_meta( $attachment_id, Sync::META_KEYS['syncing'] );
168169

169170
if ( ! defined( 'DOING_BULK_SYNC' ) ) {
170171
$this->sync->managers['upload']->add_to_sync( $attachment_id ); // Auto sync if upgrading outside of bulk sync.

0 commit comments

Comments
 (0)