Changeset 1856

Show
Ignore:
Timestamp:
01/20/12 09:34:26 (4 months ago)
Author:
Colin
Message:

unxsVZ added another wait condition for ChangeIPContainer().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jobqueue.c

    r1853 r1856  
    974974        if(system(gcQuery)) 
    975975        { 
    976                 logfileLine("ChangeIPContainer","Job returned to queue"); 
     976                logfileLine("ChangeIPContainer","Job returned to queue no such container"); 
    977977                tJobWaitingUpdate(uJob); 
    978978                return; 
    979979        } 
     980 
     981        //Check 2-. Wait till any other jobs currently in the job queue for this 
     982        //      container are done. 
     983        sprintf(gcQuery,"SELECT uJob FROM tJob" 
     984                        " WHERE uContainer=%u AND (uJobStatus=%u OR uJobStatus=%u)",uContainer,uWAITING,uRUNNING); 
     985        mysql_query(&gMysql,gcQuery); 
     986        if(mysql_errno(&gMysql)) 
     987        { 
     988                logfileLine("ChangeIPContainer",mysql_error(&gMysql)); 
     989                exit(2); 
     990        } 
     991        res=mysql_store_result(&gMysql); 
     992        if((field=mysql_fetch_row(res))) 
     993        { 
     994                logfileLine("ChangeIPContainer","Job returned to queue other jobs pending"); 
     995                tJobWaitingUpdate(uJob); 
     996                mysql_free_result(res); 
     997                return; 
     998        } 
     999        mysql_free_result(res); 
    9801000 
    9811001