Skip to content

Commit 315d286

Browse files
authored
Added debug/warning logs to identify the 'no steps to execute' issue. #25
1 parent 3ee5325 commit 315d286

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: job.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ int Job::Execute()
8686

8787
if (!steps)
8888
{
89+
LogMessage("No steps found for jobid " + m_jobid, LOG_WARNING);
8990
m_status = "i";
9091
return -1;
9192
}
@@ -110,13 +111,17 @@ int Job::Execute()
110111
" FROM pgagent.pga_jobstep WHERE jstid=" + stepid);
111112

112113
if (res)
114+
{
113115
rc = res->RowsAffected();
116+
LogMessage("Number of rows affected for jobid " + m_jobid, LOG_DEBUG);
117+
}
114118
else
115119
rc = -1;
116120
}
117121

118122
if (rc != 1)
119123
{
124+
LogMessage("Value of rc is " + std::to_string(rc) + " for job " + m_jobid, LOG_WARNING);
120125
m_status = "i";
121126
return -1;
122127
}
@@ -380,6 +385,7 @@ int Job::Execute()
380385
default:
381386
{
382387
output = "Invalid step type!";
388+
LogMessage("Invalid step type!", LOG_WARNING);
383389
m_status = "i";
384390
return -1;
385391
}
@@ -437,6 +443,9 @@ void JobThread::operator()()
437443
}
438444
else
439445
{
446+
LogMessage("Failed to launch the thread for job " + m_jobid +
447+
". Inserting an entry to the joblog table with status 'i'", LOG_WARNING);
448+
440449
// Failed to launch the thread. Insert an entry with
441450
// "internal error" status in the joblog table, to leave
442451
// a trace of fact that we tried to launch the job.

0 commit comments

Comments
 (0)