[pmwiki-users-fr] About Import cookbook : have some delay before import is processed ?

Petko Yotov 5ko at 5ko.fr
Dim 29 Juin 06:08:19 PDT 2025


The $ImportFreq variable seems to be the number of seconds since the 
previous successful import. If so, and your data file is generated once 
a week, the previous import was longer than 3600 seconds ago.

If it takes several seconds to write the file, and there is a visitor or 
a bot on the wiki, the import function may start.

A simple workaround is to save the text in a temporary file with a name 
that does not look like a wiki pagename, for example "Group.Name,new".

After the generation is complete, your script can move the file to the 
correct file name "Group.Name". This is instant, the full content 
becomes available as an expected file name, and the next wiki visitor 
should trigger the import.

Petko

On 29/06/2025 14:20, ABClf wrote:
> Hello,
> 
> I'm doing some tests with import cookbook ;
> it works ; but, for my current test case, it works to fast :
> I trying to generate a (sort of) data file with awk script collecting
> data from my wiki.d pages (cron once every week), saved in import
> folder, so as to get my data file updated every week.
> The awk script takes long and it looks to me that import starts before
> the generated file is completed.
> 
> My config says :
> 
> # load script
> include_once('cookbook/import.php');
> # check for new files at least once per hour
> $ImportFreq = 3600;
> 
> Then, I was expecting import.php to run only once in an hour.
> Rather than that, it looks like it's running as soon as something new
> comes in the import folder.
> Am I right ?
> Any way to delay the process, say 10 minutes ?
> 
> Thank you,
> Gilles.
> 
> _______________________________________________
> pmwiki-users-fr mailing list
> pmwiki-users-fr at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users-fr



Plus d'informations sur la liste de diffusion pmwiki-users-fr