@@ -109,9 +109,11 @@ public function startImportDropbox(string $accessToken, string $userId): array {
109109 public function importDropboxJob (string $ userId ): void {
110110 $ this ->logger ->error ('Importing dropbox files for ' . $ userId );
111111 $ importingDropbox = $ this ->config ->getUserValue ($ userId , Application::APP_ID , 'importing_dropbox ' , '0 ' ) === '1 ' ;
112- if (!$ importingDropbox ) {
112+ $ jobRunning = $ this ->config ->getUserValue ($ userId , Application::APP_ID , 'dropbox_import_running ' , '0 ' ) === '1 ' ;
113+ if (!$ importingDropbox || $ jobRunning ) {
113114 return ;
114115 }
116+ $ this ->config ->setUserValue ($ userId , Application::APP_ID , 'dropbox_import_running ' , '1 ' );
115117
116118 $ accessToken = $ this ->config ->getUserValue ($ userId , Application::APP_ID , 'token ' , '' );
117119 $ refreshToken = $ this ->config ->getUserValue ($ userId , Application::APP_ID , 'refresh_token ' , '' );
@@ -140,6 +142,7 @@ public function importDropboxJob(string $userId): void {
140142 $ this ->config ->setUserValue ($ userId , Application::APP_ID , 'last_dropbox_import_timestamp ' , $ ts );
141143 $ this ->jobList ->add (ImportDropboxJob::class, ['user_id ' => $ userId ]);
142144 }
145+ $ this ->config ->setUserValue ($ userId , Application::APP_ID , 'dropbox_import_running ' , '0 ' );
143146 }
144147
145148 /**
0 commit comments