Changeset 3266148
- Timestamp:
- 04/03/2025 08:55:55 AM (12 months ago)
- Location:
- watchful
- Files:
-
- 8 edited
- 1 copied
-
tags/v2.0.4 (copied) (copied from watchful/trunk)
-
tags/v2.0.4/lib/Helpers/PluginManager.php (modified) (1 diff)
-
tags/v2.0.4/lib/Helpers/ThemeUpdater.php (modified) (7 diffs)
-
tags/v2.0.4/readme.txt (modified) (1 diff)
-
tags/v2.0.4/watchful.php (modified) (1 diff)
-
trunk/lib/Helpers/PluginManager.php (modified) (1 diff)
-
trunk/lib/Helpers/ThemeUpdater.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/watchful.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
watchful/tags/v2.0.4/lib/Helpers/PluginManager.php
r3257611 r3266148 11 11 class PluginManager 12 12 { 13 p rivate const LOCK_NAME = 'install_update_plugin';13 public const LOCK_NAME = 'install_update'; 14 14 private $logger; 15 15 private $lock_factory; -
watchful/tags/v2.0.4/lib/Helpers/ThemeUpdater.php
r3257611 r3266148 10 10 class ThemeUpdater 11 11 { 12 private const LOCK_NAME = 'install_update_theme';13 12 private $logger; 14 13 private $lock_factory; … … 56 55 57 56 if ($use_lock) { 58 $lock = $this->lock_factory->acquire( self::LOCK_NAME);57 $lock = $this->lock_factory->acquire(PluginManager::LOCK_NAME); 59 58 } 60 59 61 60 if ($use_lock && !$lock) { 62 61 $this->logger->log('Could not acquire lock', [ 63 'lock_name' => self::LOCK_NAME,62 'lock_name' => PluginManager::LOCK_NAME, 64 63 ], Logger::WARNING); 65 64 throw new Exception('Theme update is already in progress', 409); … … 73 72 74 73 if ($use_lock) { 75 $this->lock_factory->release( self::LOCK_NAME);74 $this->lock_factory->release(PluginManager::LOCK_NAME); 76 75 } 77 76 … … 83 82 84 83 if ($use_lock) { 85 $this->lock_factory->release( self::LOCK_NAME);84 $this->lock_factory->release(PluginManager::LOCK_NAME); 86 85 } 87 86 … … 120 119 121 120 if ($use_lock) { 122 $this->lock_factory->release( self::LOCK_NAME);121 $this->lock_factory->release(PluginManager::LOCK_NAME); 123 122 } 124 123 … … 162 161 } finally { 163 162 if ($use_lock) { 164 $this->lock_factory->release( self::LOCK_NAME);163 $this->lock_factory->release(PluginManager::LOCK_NAME); 165 164 } 166 165 } … … 336 335 ]); 337 336 338 throw new Exception($error_message, $error_code, [337 throw new Exception($error_message, (int)$error_code, [ 339 338 'theme' => $slug, 340 339 'is_installed' => $this->is_installed($slug), -
watchful/tags/v2.0.4/readme.txt
r3257611 r3266148 83 83 84 84 == Changelog == 85 = v2.0.4 = 86 * Use the same lock when updating plugins and themes 87 85 88 = v2.0.3 = 86 89 * Add logs to backup processor class -
watchful/tags/v2.0.4/watchful.php
r3257611 r3266148 4 4 * Plugin URI: https://app.watchful.net 5 5 * Description: Remote Website Management Plugin by Watchful 6 * Version: 2.0. 36 * Version: 2.0.4 7 7 * Author: watchful 8 8 * Author URI: https://watchful.net -
watchful/trunk/lib/Helpers/PluginManager.php
r3257611 r3266148 11 11 class PluginManager 12 12 { 13 p rivate const LOCK_NAME = 'install_update_plugin';13 public const LOCK_NAME = 'install_update'; 14 14 private $logger; 15 15 private $lock_factory; -
watchful/trunk/lib/Helpers/ThemeUpdater.php
r3257611 r3266148 10 10 class ThemeUpdater 11 11 { 12 private const LOCK_NAME = 'install_update_theme';13 12 private $logger; 14 13 private $lock_factory; … … 56 55 57 56 if ($use_lock) { 58 $lock = $this->lock_factory->acquire( self::LOCK_NAME);57 $lock = $this->lock_factory->acquire(PluginManager::LOCK_NAME); 59 58 } 60 59 61 60 if ($use_lock && !$lock) { 62 61 $this->logger->log('Could not acquire lock', [ 63 'lock_name' => self::LOCK_NAME,62 'lock_name' => PluginManager::LOCK_NAME, 64 63 ], Logger::WARNING); 65 64 throw new Exception('Theme update is already in progress', 409); … … 73 72 74 73 if ($use_lock) { 75 $this->lock_factory->release( self::LOCK_NAME);74 $this->lock_factory->release(PluginManager::LOCK_NAME); 76 75 } 77 76 … … 83 82 84 83 if ($use_lock) { 85 $this->lock_factory->release( self::LOCK_NAME);84 $this->lock_factory->release(PluginManager::LOCK_NAME); 86 85 } 87 86 … … 120 119 121 120 if ($use_lock) { 122 $this->lock_factory->release( self::LOCK_NAME);121 $this->lock_factory->release(PluginManager::LOCK_NAME); 123 122 } 124 123 … … 162 161 } finally { 163 162 if ($use_lock) { 164 $this->lock_factory->release( self::LOCK_NAME);163 $this->lock_factory->release(PluginManager::LOCK_NAME); 165 164 } 166 165 } … … 336 335 ]); 337 336 338 throw new Exception($error_message, $error_code, [337 throw new Exception($error_message, (int)$error_code, [ 339 338 'theme' => $slug, 340 339 'is_installed' => $this->is_installed($slug), -
watchful/trunk/readme.txt
r3257611 r3266148 83 83 84 84 == Changelog == 85 = v2.0.4 = 86 * Use the same lock when updating plugins and themes 87 85 88 = v2.0.3 = 86 89 * Add logs to backup processor class -
watchful/trunk/watchful.php
r3257611 r3266148 4 4 * Plugin URI: https://app.watchful.net 5 5 * Description: Remote Website Management Plugin by Watchful 6 * Version: 2.0. 36 * Version: 2.0.4 7 7 * Author: watchful 8 8 * Author URI: https://watchful.net
Note: See TracChangeset
for help on using the changeset viewer.