Running batch jobs [message #5045] |
Fri, 09 October 2015 21:50 |
edortizq
Messages: 82 Registered: August 2008 Location: Ecuador
|
Member |
|
|
Dear Tony, I'm trying to run my first batch job, so I created a task using the BATCH pattern, then I try some testing code truncating some tables but nothing happens, when I try to debug my script it never stops on the breakpoints wich are on the generated script.
I'm trying to run this batch task by pressing a navigation button from a multi5 task.
However it's definitely running something because it shows a batch_log_filepicker task after pressing the button and I can open the html output file.
The testing code is:
<?php
//********************************************************** *******************
// run a script in the background
//********************************************************** *******************
$stdout = '../logs/detallemuestras.html';
$csvout = '../logs/detallemuestras.csv';
$pdfout = '../logs/detallemuestras.pdf';
ini_set('include_path', '.');
require 'std.batch.inc';
batchInit(__FILE__);
$conn1millaQry = mysqli_connect('localhost', 'remoto', 'inp1milla', 'unamillaqry');
if (!$conn1millaQry) {
die('No se puede conectar a DB UNAMILLAQRY: ' . mysql_error());
}
echo 'Conexion Exitosa a UNAMILLAQRY'.'<br>';
mysqli_query($conn1millaQry,'TRUNCATE TABLE artespesca');
mysqli_query($conn1millaQry,'TRUNCATE TABLE componentes');
mysqli_query($conn1millaQry,'TRUNCATE TABLE detallemuestras');
mysqli_close($conn1millaQry);
batchEnd();
?>
The html output file (detallemuestras.html) only have this:
user_id : MGR
role_id : GLOBAL
What I'm doing wrong?
Thanks for advance!!
Best regards,
Edgar
|
|
|
Re: Running batch jobs [message #5052 is a reply to message #5045] |
Sat, 10 October 2015 05:17 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
You cannot start a batch job from a navigation button and expect it to appear in your debugger. You need to open the script in your IDE and start the debugging session from there. You can then step through the script line by line, or until it hits a breakpoint.
BTW, have you set up the correct options in your batch.ini file?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|