BioContainers / biocontainers-backend

Python backend for Biocontainers (Flask + MongoDB)
http://biocontainers.pro
Apache License 2.0
3 stars 1 forks source link

Number of tools is wrong #9

Closed ypriverol closed 5 years ago

ypriverol commented 5 years ago

@chakrabandla

The number of tools looks wrong. When we query with http://api.biocontainers.pro/api/v2/tools?limit=40&offset=0 the latest page said is 7320.

{
  "date": "Mon, 25 Feb 2019 17:19:53 GMT",
  "content-encoding": "gzip",
  "next_page": "/tools?limit=40&offset=40",
  "server": "cloudflare",
  "transfer-encoding": "chunked",
  "current_offset": "0",
  "content-type": "application/json",
  "current_limit": "40",
  "last_page": "/tools?limit=40&offset=7320",
  "connection": "keep-alive",
  "cf-ray": "4aebd6e10c236aa9-LHR",
  "self_link": "/tools?limit=40&offset=0"
}

This means that we have more than 200'000 tools. Which is not the case.

ypriverol commented 5 years ago

The number of pages can be estimated as:

last_page: offset/limit + 1

Thanks, @chakrabandla for the discussion.