From languefrancaise at gmail.com Sun Jun 29 05:20:27 2025 From: languefrancaise at gmail.com (ABClf) Date: Sun, 29 Jun 2025 14:20:27 +0200 Subject: [pmwiki-users-fr] About Import cookbook : have some delay before import is processed ? Message-ID: 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. From 5ko at 5ko.fr Sun Jun 29 06:08:19 2025 From: 5ko at 5ko.fr (Petko Yotov) Date: Sun, 29 Jun 2025 15:08:19 +0200 Subject: [pmwiki-users-fr] About Import cookbook : have some delay before import is processed ? In-Reply-To: References: Message-ID: <58be1be6239c42ddb8e9a2c18dd31197@5ko.fr> 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 From languefrancaise at gmail.com Sun Jun 29 06:39:43 2025 From: languefrancaise at gmail.com (ABClf) Date: Sun, 29 Jun 2025 15:39:43 +0200 Subject: [pmwiki-users-fr] About Import cookbook : have some delay before import is processed ? In-Reply-To: <58be1be6239c42ddb8e9a2c18dd31197@5ko.fr> References: <58be1be6239c42ddb8e9a2c18dd31197@5ko.fr> Message-ID: I'm going to try this ; thank you for your assistance Petko. Le dim. 29 juin 2025 à 15:08, Petko Yotov <5ko at 5ko.fr> a écrit : > > 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