time.sleep(30)
            
            print "Completed Loop. Awaiting any final Completions."
            gc.collect()
            del gc.garbage[:]
            
            while sema.getValue()>0 and len(pool)>0:
                print "Waiting for Completion"
                time.sleep(random.randint(1,120))
            
            if len(pool) is 0 and sema.getValue() >0:
                    sema.setValue(0, lock)
            
                
                
            print "Current Execution List Complete. Will Restart Soon!"
                        
if __name__ == '__main__':
    fpath=sys.argv[1]
    #fpath="/home/aevans/Documents/workspace-sts-3.5.1.RELEASE/CACIVIL/Parsers/Conf/test.conf"
    
    p=Psyco(fpath)
    drops=[]
    creates=[]
    creates.append("CREATE TABLE IF NOT EXISTS crawlers.ca_crim_parsers_not_run (name text, date timestamp default current_timestamp)")
    creates.append("CREATE TABLE IF NOT EXISTS crawlers.ca_crim_parsers_running (name text, date timestamp default current_timestamp)")
    creates.append("CREATE TABLE IF NOT EXISTS crawlers.ca_crim_parsers_complete (name text, crawlstamp timestamp, date timestamp default current_timestamp)")
    p.prep(drops, creates)
    
    c=Controller(fpath)
    c.parse()