Skip to content

Commit

Permalink
Optimize POST processing script messages and add cache cleanup (missing)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackysi committed Jan 6, 2025
1 parent ae1d471 commit b8e9b9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
16 changes: 4 additions & 12 deletions inc/lib/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ public function get( $key ) {
$name = $this->parseKey( $key );
$data = false;


// Various Modes / Actions
switch ( $this->options[ 'mode' ] ) {

Expand Down Expand Up @@ -568,21 +567,18 @@ public function delete( $key ) {
$deleted = apc_delete( $name );
break;


// APCu extension uses its own calls
case 'apcu':
$deleted = apcu_delete( $name );
break;


// Redis method
case 'memcache':
case 'memcached':
case 'redis':
$deleted = $this->object->delete( $name );
break;


// Default is always disk cache
default:

Expand All @@ -598,16 +594,12 @@ public function delete( $key ) {
}

// If cache key was successfully deleted, also clean it from cache_store
if ( $deleted === true ) {

// Ignore cache_store, should never be deleted
if ( $key !== 'cache_store' ) {
$this->stack( 'delete', $key );
}

// Ignore cache_store, should never be deleted
if ( ( $deleted === true ) && $key !== 'cache_store' ) {
$this->stack( 'delete', $key );
}

return false;
return $deleted;

}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "git+https://github.com/Jackysi/PawTunes.git"
},
"license": "MPL-2.0",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"scripts": {
"dev": "gulp dev",
Expand Down
2 changes: 2 additions & 0 deletions panel/lib/API/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public function __invoke() {

$this->downloadUpdate();
$this->extractUpdate();

$this->sendSSE( "<div>Processing installation...</div>" );
$this->postUpdate( $this->path );

// Delete zip file & temp file
Expand Down
2 changes: 1 addition & 1 deletion src/panel/js/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function shouldUpdate( serverVersion, localVersion, segments = 3 ) {
`<div class="alert alert-warning alert-icon">
<div class="content">
Running a post-update script, please do not interrupt this process...
<pre class="post-update">Loading, please wait...</pre>
<pre class="post-update">Processing...</pre>
</div>
</div>`
);
Expand Down

0 comments on commit b8e9b9d

Please sign in to comment.