We’re experiencing extremely long response time and trying to figure out why. It targets specifically Forest Admin on all environments. Somehow queries have trouble to access the FA Front End, while the general navigation is working fine.
One example:
router.get('/integrations/:place_id/relationships/categories', (request, response, next) => {
const place_id = request.params.place_id;
const recordSerializer = new RecordSerializer({ name: 'categories' });
// Get query parameters information
const pageSize = Number(request.query.page.size) || 20;
const page = Number(request.query.page.number) || 1;
const from = (page - 1) * pageSize;
const to = from + pageSize;
axios.get(`${API_URL}/forest_admin/places/${place_id}/maintenance_contract_categories`, {
headers: {
'Authorization': `Bearer ${process.env.ACCESS_TOKEN}`,
'X-CURRENT-USER-EMAIL': request.user.email
}
}).then(async res => {
if (res.data) {
const result = res.data.map(category => {
return {
id: category.id,
display_name: category.display_name,
mandatory: category.mandatory,
default: category.default,
state: category.current_maintenance_contract ? category.current_maintenance_contract.state : '',
provider: category.current_maintenance_contract ? `${category.current_maintenance_contract.provider.sage_provider.raison_sociale} - ${category.current_maintenance_contract.provider.sage_provider.site_ville}` : '',
reference: category.current_maintenance_contract ? category.current_maintenance_contract.reference : '',
origin_date: category.current_maintenance_contract ? category.current_maintenance_contract.origin_date : null,
end_date: category.current_maintenance_contract ? category.current_maintenance_contract.end_date : null,
notice_in_month: category.current_maintenance_contract ? category.current_maintenance_contract.notice_in_month : '',
automatic_renewal: category.current_maintenance_contract ? category.current_maintenance_contract.automatic_renewal : '',
amount: category.current_maintenance_contract ? category.current_maintenance_contract.amount : '',
repartition_key_id: category.current_maintenance_contract ? category.current_maintenance_contract.repartition_key_id : '',
maintenanceContract: {
id: category.current_maintenance_contract ? category.current_maintenance_contract.id : null
},
};
}).sort((a, b) => {
return (a.mandatory === b.mandatory) ? 0 : a.mandatory ? -1 : 1;
});
response.send({
...(await recordSerializer.serialize(result.slice(from, to))),
meta: { count: res.data.length }
});
}
}).catch(() => {
response.send({ data: [] });
});
});
This request took 9 minutes to reach FA
On my back end, my script execute almost immediately. It’s really the response.send which takes 9 minutes…
Context
Please provide in this mandatory section, the relevant information about your configuration:
- Project name: Sergic
- Team name: Gestion
- Environment name: All
- Agent type & version:
“forest-express”: “^7.9.4”,
“forest-express-sequelize”: “^7.12.3”, - Recent changes made on your end if any: none