File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818class MessageManagement implements MessageManagementInterface
1919{
20+ private const LOCK_FILE = 'discorgento_queue.lock ' ;
21+
2022 private DateTime $ date ;
2123 private FileDriver $ fileDriver ;
2224 private LoggerInterface $ logger ;
@@ -127,20 +129,20 @@ public function getToBeRetried()
127129 */
128130 private function checkLockfile ()
129131 {
130- $ lockfilePath = DirectoryList::VAR_DIR . ' /discorgento_queue.lock ' ;
131- if ($ this ->fileDriver ->isFile ($ lockfilePath )) {
132+ $ lockFilepath = BP . DIRECTORY_SEPARATOR . DirectoryList::VAR_DIR . DIRECTORY_SEPARATOR . self :: LOCK_FILE ;
133+ if ($ this ->fileDriver ->isFile ($ lockFilepath )) {
132134 $ lockTimeLifespan = floatval ($ this ->scopeConfig ->getValue ('queue/general/lockfile_expires ' )) * 3600 ?: 3600 ;
133- if (time () - filectime ($ lockfilePath ) < $ lockTimeLifespan ) {
135+ if (time () - filectime ($ lockFilepath ) < $ lockTimeLifespan ) {
134136 throw new LocalizedException (
135- __ ('Queue already running! If you think this is mistake, delete the "%1" lock file. ' , $ lockfilePath )
137+ __ ('Queue already running! If you think this is mistake, delete the "%1" lock file. ' , $ lockFilepath )
136138 );
137139 }
138140
139- $ this ->fileDriver ->deleteFile ($ lockfilePath );
141+ $ this ->fileDriver ->deleteFile ($ lockFilepath );
140142 }
141143
142- $ this ->fileDriver ->touch ($ lockfilePath );
144+ $ this ->fileDriver ->touch ($ lockFilepath );
143145
144- return $ lockfilePath ;
146+ return $ lockFilepath ;
145147 }
146148}
You can’t perform that action at this time.
0 commit comments