Revision 1ad47ca5

b/snf-cyclades-app/synnefo/logic/reconciliation.py
147 147
    for i in idD & idG:
148 148
        if not G[i] and D[i] == 'BUILD':
149 149
            vm = VirtualMachine.objects.get(id=i)
150
            # Check time to avoid many rapi calls
151
            if datetime.now() > vm.backendtime + timedelta(seconds=5):
150
            if not vm.backendjobid:  # VM has not been enqueued in the backend
151
                if datetime.now() > vm.created + timedelta(seconds=120):
152
                    # If a job has not been enqueued after 2 minutues, then
153
                    # it must be a stale entry..
154
                    failed.add(i)
155
            elif datetime.now() > vm.backendtime + timedelta(seconds=30):
156
                # Check time to avoid many rapi calls
152 157
                with pooled_rapi_client(vm) as c:
153 158
                    try:
154 159
                        job_info = c.GetJobStatus(job_id=vm.backendjobid)

Also available in: Unified diff