You are here:  » Cron with slow import


Cron with slow import

Submitted by marco on Sat, 2018-06-09 12:10 in

Hello,

I am a bit confused in how to set up a cron with slow import for one specific merchant.
Have read this thread, but it is referring to a non existing file:
https://www.pricetapestry.com/node/4945

Maybe it is changed for a later version?
I am using 16/10A with UPDATE / INSERT modification (5513 / 6255).

Best Regards,
Marco

Submitted by support on Mon, 2018-06-11 09:15

Hi Marco,

I discontinued scripts/import_slow.php as it can be quite tricky to schedule as it must be invoked over HTTP, and in a way that will retry as many times as required.

However, if you would like to email me the current includes/admin.php that you are using for reference I'll forward something for you to try...

Cheers,
David.
--
PriceTapestry.com

Submitted by marco on Tue, 2018-06-12 06:13

Hi David,

I am not using it because of performance, but because I would like to add a unique datetime for every product at import.
I have set slowImportBlock and slowImportSleep at 1 and have added to admin.php:

if ($admin_importFeed["filename"]== "cata.csv") {
$importRecord["addeddate"] = date('Y-m-d H:i:s');
}

So perhaps the same can be achieved much easier with the regular (cron) import process?
How to add a loop that adds a second to the datetime for every import of the feed?

Best,
Marco

Submitted by support on Tue, 2018-06-12 08:19

Hi Marco,

Try something like this;

if ($admin_importFeed["filename"]== "cata.csv") {
  global $admin_importTime;
  if (!isset($admin_importTime))
  {
    $admin_importTime = time();
  }
  else
  {
    $admin_importTime = $admin_importTime + 1; // or more seconds as required
  }
  $importRecord["addeddate"] = date('Y-m-d H:i:s',$admin_importTime);
}

Cheers,
David.
--
PriceTapestry.com

Submitted by marco on Thu, 2018-06-14 12:09

Thanks!