From 8b5b1a0155d54571982dc11bcb92e39c01ff11e9 Mon Sep 17 00:00:00 2001 From: dkorol Date: Mon, 30 May 2016 12:52:04 +0300 Subject: [PATCH] bugfix --- run.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/run.php b/run.php index 8e53a0e..cd10476 100644 --- a/run.php +++ b/run.php @@ -24,12 +24,15 @@ if (file_exists($lockFile)) { file_put_contents($lockFile, strtotime('+5 minutes')); if (file_exists(__DIR__ . "/logs/sync.log")) { - $config['date_from'] = file_get_contents(__DIR__ . "/logs/sync.log"); + $lastSyncTime = file_get_contents(__DIR__ . "/logs/sync.log"); + $lastSyncTime = new DateTime($lastSyncTime); + $lastSyncTime->sub(new DateInterval('PT1M')); + $config['date_from'] = $lastSyncTime->format('Y-m-d H:i:s'); } -$apiHelper = new ApiHelper($сonfig); +$apiHelper = new ApiHelper($config); if ($apiHelper->processXMLOrders()) { unlink($lockFile); file_put_contents(__DIR__ . "/logs/sync.log", $startTime); -} \ No newline at end of file +}