def get_count()

in cloudrun/queue/src/routes/queue.py [0:0]


def get_count():
  ct = 0
  docs = db.collection(u"document").stream()
  for doc in docs:
    a = doc.to_dict()
    #print(a)
    #print("loop")
    b = a["system_status"]
    if type(b) == list:
      #print("in loop")
      for i in b:
        l = len(b)
        if l == 1:
          #print("loop")
          if i["stage"] == "uploaded" and i["status"] == STATUS_SUCCESS:
            ct = ct + 1

  return ct