Forráskód Böngészése

Kolejna drobna poprawka do WMS - prawidłowe uruchamianie konwersji plików tif w tle

Mariusz Muszyński 9 éve
szülő
commit
777ee6c220
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      SE/se-lib/Route/UrlAction/WmsGenerate.php

+ 2 - 1
SE/se-lib/Route/UrlAction/WmsGenerate.php

@@ -495,6 +495,7 @@ fi
 
 			$layers=DB::getPDO()->fetchall("select ID,FILE_NAME from WMS_LAYERS where LAYER_TYPE='GeoTIFF' and FILE_STATUS='TO_GENERATE'");
 			foreach ($layers as $layer) {
+echo $layer['ID']."\n";
 				$destFolderPath = $this->getDirectory($layer['ID']);
 				if(!is_file($destFolderPath.'/'.$layer['FILE_NAME'])) {
 					DB::getDB()->UPDATE_OBJ('WMS_LAYERS',(object) array('ID'=>$layer['ID'],'FILE_STATUS'=>'ERROR','FILE_STATUS_INFO'=>'Wystąpił błąd pliku tif'));
@@ -510,7 +511,7 @@ fi
 				$replace = array($layer['ID'],$destFolderPath,$layer['FILE_NAME']);
 				$bash = str_replace($search,$replace,$bashSchema);
 				file_put_contents('/tmp/generate_wms-'.$layer['ID'].'.sh',$bash);
-				shell_exec('su - root -c "nohup /bin/sh /tmp/generate_wms-'.$layer['ID'].'.sh >> /tmp/generate_wms-'.$layer['ID'].'.log"');
+				shell_exec('su - root -c "/bin/sh /tmp/generate_wms-'.$layer['ID'].'.sh > /tmp/generate_wms-'.$layer['ID'].'.log 2>&1 &"');
 			}
 				
 		} catch (Exception $e) {