Plugin Directory

Changeset 3266148


Ignore:
Timestamp:
04/03/2025 08:55:55 AM (12 months ago)
Author:
watchful
Message:

v2.0.4

Location:
watchful
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • watchful/tags/v2.0.4/lib/Helpers/PluginManager.php

    r3257611 r3266148  
    1111class PluginManager
    1212{
    13     private const LOCK_NAME = 'install_update_plugin';
     13    public const LOCK_NAME = 'install_update';
    1414    private $logger;
    1515    private $lock_factory;
  • watchful/tags/v2.0.4/lib/Helpers/ThemeUpdater.php

    r3257611 r3266148  
    1010class ThemeUpdater
    1111{
    12     private const LOCK_NAME = 'install_update_theme';
    1312    private $logger;
    1413    private $lock_factory;
     
    5655
    5756        if ($use_lock) {
    58             $lock = $this->lock_factory->acquire(self::LOCK_NAME);
     57            $lock = $this->lock_factory->acquire(PluginManager::LOCK_NAME);
    5958        }
    6059
    6160        if ($use_lock && !$lock) {
    6261            $this->logger->log('Could not acquire lock', [
    63                 'lock_name' => self::LOCK_NAME,
     62                'lock_name' => PluginManager::LOCK_NAME,
    6463            ],                 Logger::WARNING);
    6564            throw new Exception('Theme update is already in progress', 409);
     
    7372
    7473            if ($use_lock) {
    75                 $this->lock_factory->release(self::LOCK_NAME);
     74                $this->lock_factory->release(PluginManager::LOCK_NAME);
    7675            }
    7776
     
    8382
    8483            if ($use_lock) {
    85                 $this->lock_factory->release(self::LOCK_NAME);
     84                $this->lock_factory->release(PluginManager::LOCK_NAME);
    8685            }
    8786
     
    120119
    121120            if ($use_lock) {
    122                 $this->lock_factory->release(self::LOCK_NAME);
     121                $this->lock_factory->release(PluginManager::LOCK_NAME);
    123122            }
    124123
     
    162161        } finally {
    163162            if ($use_lock) {
    164                 $this->lock_factory->release(self::LOCK_NAME);
     163                $this->lock_factory->release(PluginManager::LOCK_NAME);
    165164            }
    166165        }
     
    336335        ]);
    337336
    338         throw new Exception($error_message, $error_code, [
     337        throw new Exception($error_message, (int)$error_code, [
    339338            'theme' => $slug,
    340339            'is_installed' => $this->is_installed($slug),
  • watchful/tags/v2.0.4/readme.txt

    r3257611 r3266148  
    8383
    8484== Changelog ==
     85= v2.0.4 =
     86* Use the same lock when updating plugins and themes
     87
    8588= v2.0.3 =
    8689* Add logs to backup processor class
  • watchful/tags/v2.0.4/watchful.php

    r3257611 r3266148  
    44 * Plugin URI: https://app.watchful.net
    55 * Description: Remote Website Management Plugin by Watchful
    6  * Version: 2.0.3
     6 * Version: 2.0.4
    77 * Author: watchful
    88 * Author URI: https://watchful.net
  • watchful/trunk/lib/Helpers/PluginManager.php

    r3257611 r3266148  
    1111class PluginManager
    1212{
    13     private const LOCK_NAME = 'install_update_plugin';
     13    public const LOCK_NAME = 'install_update';
    1414    private $logger;
    1515    private $lock_factory;
  • watchful/trunk/lib/Helpers/ThemeUpdater.php

    r3257611 r3266148  
    1010class ThemeUpdater
    1111{
    12     private const LOCK_NAME = 'install_update_theme';
    1312    private $logger;
    1413    private $lock_factory;
     
    5655
    5756        if ($use_lock) {
    58             $lock = $this->lock_factory->acquire(self::LOCK_NAME);
     57            $lock = $this->lock_factory->acquire(PluginManager::LOCK_NAME);
    5958        }
    6059
    6160        if ($use_lock && !$lock) {
    6261            $this->logger->log('Could not acquire lock', [
    63                 'lock_name' => self::LOCK_NAME,
     62                'lock_name' => PluginManager::LOCK_NAME,
    6463            ],                 Logger::WARNING);
    6564            throw new Exception('Theme update is already in progress', 409);
     
    7372
    7473            if ($use_lock) {
    75                 $this->lock_factory->release(self::LOCK_NAME);
     74                $this->lock_factory->release(PluginManager::LOCK_NAME);
    7675            }
    7776
     
    8382
    8483            if ($use_lock) {
    85                 $this->lock_factory->release(self::LOCK_NAME);
     84                $this->lock_factory->release(PluginManager::LOCK_NAME);
    8685            }
    8786
     
    120119
    121120            if ($use_lock) {
    122                 $this->lock_factory->release(self::LOCK_NAME);
     121                $this->lock_factory->release(PluginManager::LOCK_NAME);
    123122            }
    124123
     
    162161        } finally {
    163162            if ($use_lock) {
    164                 $this->lock_factory->release(self::LOCK_NAME);
     163                $this->lock_factory->release(PluginManager::LOCK_NAME);
    165164            }
    166165        }
     
    336335        ]);
    337336
    338         throw new Exception($error_message, $error_code, [
     337        throw new Exception($error_message, (int)$error_code, [
    339338            'theme' => $slug,
    340339            'is_installed' => $this->is_installed($slug),
  • watchful/trunk/readme.txt

    r3257611 r3266148  
    8383
    8484== Changelog ==
     85= v2.0.4 =
     86* Use the same lock when updating plugins and themes
     87
    8588= v2.0.3 =
    8689* Add logs to backup processor class
  • watchful/trunk/watchful.php

    r3257611 r3266148  
    44 * Plugin URI: https://app.watchful.net
    55 * Description: Remote Website Management Plugin by Watchful
    6  * Version: 2.0.3
     6 * Version: 2.0.4
    77 * Author: watchful
    88 * Author URI: https://watchful.net
Note: See TracChangeset for help on using the changeset viewer.