refactor(logging): remove agent logging from various components to streamline code and improve maintainability
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m49s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m49s
This commit is contained in:
@@ -412,18 +412,12 @@ app.post('/api/server-filters/:serverId', serverConfigsRoutes.postServerFilters)
|
||||
// === LOCKS ===
|
||||
app.get('/api/locks/:resource', (req, res) => {
|
||||
const status = getLockStatus(req.params.resource);
|
||||
// #region agent log
|
||||
fetch('http://192.168.10.2:7343/ingest/aa002dd6-6968-4a35-b09d-f05302d83266',{method:'POST',headers:{'Content-Type':'application/json','X-Debug-Session-Id':'378b5f'},body:JSON.stringify({sessionId:'378b5f',runId:'baseline',hypothesisId:'H4',location:'backend/server.js:locks-get',message:'Lock status requested',data:{resource:String(req?.params?.resource||''),locked:Boolean(status?.locked)},timestamp:Date.now()})}).catch(()=>{});
|
||||
// #endregion
|
||||
res.json(status);
|
||||
});
|
||||
|
||||
app.post('/api/locks/:resource', (req, res) => {
|
||||
const { owner = 'anonymous', ttlSeconds = 120 } = req.body || {};
|
||||
const result = acquireLock(req.params.resource, owner, ttlSeconds);
|
||||
// #region agent log
|
||||
fetch('http://192.168.10.2:7343/ingest/aa002dd6-6968-4a35-b09d-f05302d83266',{method:'POST',headers:{'Content-Type':'application/json','X-Debug-Session-Id':'378b5f'},body:JSON.stringify({sessionId:'378b5f',runId:'baseline',hypothesisId:'H4',location:'backend/server.js:locks-post',message:'Lock acquire attempted',data:{resource:String(req?.params?.resource||''),owner:String(owner||''),success:Boolean(result?.success),locked:Boolean(result?.locked)},timestamp:Date.now()})}).catch(()=>{});
|
||||
// #endregion
|
||||
if (!result.success) {
|
||||
return sendError(res, 423, 'Resource is locked by another user', 'E_RESOURCE_LOCKED', {
|
||||
owner: result.owner,
|
||||
@@ -435,9 +429,6 @@ app.post('/api/locks/:resource', (req, res) => {
|
||||
|
||||
app.delete('/api/locks/:resource', (req, res) => {
|
||||
const result = releaseLock(req.params.resource);
|
||||
// #region agent log
|
||||
fetch('http://192.168.10.2:7343/ingest/aa002dd6-6968-4a35-b09d-f05302d83266',{method:'POST',headers:{'Content-Type':'application/json','X-Debug-Session-Id':'378b5f'},body:JSON.stringify({sessionId:'378b5f',runId:'baseline',hypothesisId:'H4',location:'backend/server.js:locks-delete',message:'Lock released',data:{resource:String(req?.params?.resource||''),released:Boolean(result?.released)},timestamp:Date.now()})}).catch(()=>{});
|
||||
// #endregion
|
||||
res.json(result);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user