Currently, /censuses/publish is a sync call. For big census sizes, it might be an issue if the HTTP request takes too long. Depending on the API server setup, after some time the connection might be canceled due to a timeout (502).
To fix this potential issue a new endpoint is added to the API.
POST /censues/:censusId/publish/async
This endpoint enqueues the task and returns the new censusId, using the same JSON body as currently.
Then GET /censuses/:newCensusId/check can be used to query the status of the task.
404 not found (should never happen)
204 no content, still in progress
200 ready. The call returns the JSON object with the censusId and the uri (same as sync call)
Note that once check has returned 200, the census info is removed from the queue and it won't be available for /check anymore.
Currently,
/censuses/publish
is a sync call. For big census sizes, it might be an issue if the HTTP request takes too long. Depending on the API server setup, after some time the connection might be canceled due to a timeout (502).To fix this potential issue a new endpoint is added to the API.
POST
/censues/:censusId/publish/async
This endpoint enqueues the task and returns the new
censusId
, using the same JSON body as currently.Then GET
/censuses/:newCensusId/check
can be used to query the status of the task.Note that once check has returned 200, the census info is removed from the queue and it won't be available for /check anymore.