from server2022_new import server2022 import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import messaging import time import threading import os from numba import jit, cuda import requests cred = credentials.Certificate('servicekey.json') uid = 'snQYQZqQx3SmVbRztmEqYn5Mkcz2' try: firebase_admin.initialize_app(cred, {'databaseURL': 'https://farmbase-b2f7e-31c0c.firebaseio.com/'}) except: print('fire running') idsArr = [] tempObj = {} tempArr = [1649888354315,1649901493525,1649903309359,1649909374970,1649903568843,1649885342610,1649911120127,1649888354315,1649885289948,1649911114894,1649909374970,1649907657921,1649905893774,1649910282999,1649902367586,1649910282999,1649902367586,1649909517805,1649903933496,1649888497920,1649903859714,1649904428832,1649909348620,1649908655967,1649908655967,1649888497920,1649897542248,1649886640505,1649910013275,1649898765169,1649911114894,1649893179022,1649905893774,1649898765169,1649910850766,1649909902723,1649906205405,1649909380218,1649887390183,1649884994370,1649848377275,1649847200683,1649858250245,1649858250245,1649727376035,1649847200683,1649833012960,1649841330424,1649850145865,1649823158068,1649843951518,1649856357355,1649858155818,1649736070333,1649855633296,1649840470902,1649848377275,1649841135958,1649842093287,1649844374211,1649855633296,1649843951518,1649856951533,1649849454864,1649838367954,1649841877582,1649841472461,1649841409476,1649763262345,1649758033837,1649839038719,1649817138356,1649834458175,1649844860897,1649824744201,1649824744201,1649847084427,1649858176756,1649861429404,1649877352899,1649864453086,1649844908269,1649864453086,1649871825867,1649673698919,1649842114330,1649846630058,1649846630058,1649849872704,1649860470805,1649849302306,1649866861078,1649857566755,1649859711370,1649866861078,1649863651500,1649856867290,1649857566755,1649857009159,1649843628111,1649855355479,1649847896401,1649867034611,1649864805639,1649841246402,1649855486402,1649842761032,1649842761032,1649883730777,1649848774208,1649857367249,1649842761032,1649865964818,1649556772941,1649659910445,1649593505540,1649658930009,1649859060891,1649642979251,1649553373948,1649621606447,1649679057316,1649560170447,1649850329887,1649841183378,1649841183378,1649855649006,1649845834759,1649855397343,1649855397343,1649513901655,1649847859572,1649534485647,1649559190438,1649542783838,1649544940951,1649835343471,1649525663857,1649601544831,1649951404796,1649951404796,1649976316254,1649976448673,1649998062270,1649998149634] for fieldid in tempArr: db.reference('PaidPolygonsByPolygonID').child('PMF').child(uid).child(fieldid).child('Paused').set('no') try: pending_list = db.reference('PaidPolygonsByPolygonID').child('PMF').child(uid).get() for (p,q) in pending_list.items(): try: fieldid = q["fieldID"] #print(p, fieldid) tempObj["UID"] = uid tempObj["Points"] = q["Coordinates"] tempObj["PolygonID"] = p r = requests.post('https://us-central1-farmbase-b2f7e.cloudfunctions.net/getFieldAreaByBoundaryPointsTemp', json = tempObj) time.sleep(0.3) except Exception as e: print(e) except Exception as e: print(e) print('a2')