File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
plugins/task/sessiongc/src/Extension Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -100,15 +100,16 @@ public static function getSubscribedEvents(): array
100100 private function sessionGC (ExecuteTaskEvent $ event ): int
101101 {
102102 $ enableGC = (int ) $ event ->getArgument ('params ' )->enable_session_gc ?? 1 ;
103+ $ app = $ this ->getApplication ();
103104
104105 if ($ enableGC ) {
105- $ this -> getApplication () ->getSession ()->gc ();
106+ $ app ->getSession ()->gc ();
106107 }
107108
108109 $ enableMetadata = (int ) $ event ->getArgument ('params ' )->enable_session_metadata_gc ?? 1 ;
109110
110- if ($ this -> getApplication ()-> get ( ' session_handler ' , ' none ' ) !== ' database ' && $ enableMetadata ) {
111- $ this ->metadataManager ->deletePriorTo (time () - $ this -> getApplication () ->getSession ()->getExpire ());
111+ if ($ enableMetadata ) {
112+ $ this ->metadataManager ->deletePriorTo (time () - $ app ->getSession ()->getExpire ());
112113 }
113114
114115 $ this ->logTask ('SessionGC end ' );
You can’t perform that action at this time.
0 commit comments