- if (!$aResult['no-npi']) {
- $sFileDir = CONST_BasePath.'/export/diff/';
- $sFileDir .= str_pad(floor($iFileID/1000000), 3, '0', STR_PAD_LEFT);
- $sFileDir .= '/'.str_pad(floor($iFileID/1000) % 1000, 3, '0', STR_PAD_LEFT);
-
- $sThisIndexCmd = 'bzip2 -z9 '.$sFileDir.'/'.str_pad($iFileID % 1000, 3, '0', STR_PAD_LEFT).".npi.out";
- echo "$sThisIndexCmd\n";
- exec($sThisIndexCmd, $sJunk, $iErrorLevel);
- if ($iErrorLevel)
- {
- echo "Error: $iErrorLevel\n";
- exit;
- }
-
- rename($sFileDir.'/'.str_pad($iFileID % 1000, 3, '0', STR_PAD_LEFT).".npi.out.bz2",
- $sFileDir.'/'.str_pad($iFileID % 1000, 3, '0', STR_PAD_LEFT).".npi.bz2");
- }
-
- echo "Completed for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";
- $sSQL = "INSERT INTO import_osmosis_log values ('$sBatchEnd',$iFileSize,'".date('Y-m-d H:i:s',$fCMDStartTime)."','".date('Y-m-d H:i:s')."','index')";
- $oDB->query($sSQL);
-
- $sSQL = "update import_status set lastimportdate = '$sBatchEnd'";
- $oDB->query($sSQL);
-
-
- $fDuration = time() - $fStartTime;
- echo "Completed for $sBatchEnd in ".round($fDuration/60,2)."\n";
- if (!$aResult['import-osmosis-all']) exit;
-// }
- echo "Sleeping ".max(0,60-$fDuration)." seconds\n";
- sleep(max(0,60-$fDuration));
- }
-
- }
+ $sSQL = "INSERT INTO import_osmosis_log values ('$sBatchEnd',$iFileSize,'".date('Y-m-d H:i:s',$fCMDStartTime)."','".date('Y-m-d H:i:s')."','index')";
+ var_Dump($sSQL);
+ $oDB->query($sSQL);
+ echo date('Y-m-d H:i:s')." Completed index step for $sBatchEnd in ".round((time()-$fCMDStartTime)/60,2)." minutes\n";