[project-history] migrate simple request usages to fetch-utils (#32539)

* [project-history] remove unused getQueueCounts in tests

* [project-history] migrate simple request usages to fetch-utils

GitOrigin-RevId: 0e299a9d2ea968b87d7f0f2fc1626393ca4e4fdc
This commit is contained in:
Jakob Ackermann
2026-04-01 08:05:41 +00:00
committed by Copybot
parent 7a4ee32af3
commit ad508b1882
6 changed files with 79 additions and 118 deletions
@@ -10,10 +10,10 @@
import async from 'async'
import logger from '@overleaf/logger'
import request from 'request'
import Settings from '@overleaf/settings'
import redis from '@overleaf/redis-wrapper'
import { db, ObjectId } from '../app/js/mongodb.js'
import { fetchStringWithResponse } from '@overleaf/fetch-utils'
logger.logger.level('fatal')
@@ -100,15 +100,16 @@ function checkAndClear(project, callback) {
const url = Settings.apis.documentupdater.url + '/project/' + projectId
if (force) {
console.log('3. making request to clear docupdater', url)
request.delete(url, (err, response, body) => {
console.log(
' - result of request',
err,
response && response.statusCode,
body
)
cb(err)
})
fetchStringWithResponse(url, { method: 'DELETE' }).then(
({ response, body }) => {
console.log(' - result of request: success', response.status, body)
cb()
},
err => {
console.log(' - result of request: error', err)
cb(err)
}
)
} else {
console.log('3. dry run, would request DELETE on url', url)
cb()
@@ -10,10 +10,10 @@
import async from 'async'
import logger from '@overleaf/logger'
import request from 'request'
import Settings from '@overleaf/settings'
import redis from '@overleaf/redis-wrapper'
import { db, ObjectId } from '../app/js/mongodb.js'
import { fetchStringWithResponse } from '@overleaf/fetch-utils'
logger.logger.level('fatal')
@@ -139,15 +139,16 @@ function checkAndClear(project, callback) {
const url = Settings.apis.documentupdater.url + '/project/' + projectId
if (force) {
console.log('3. making request to clear docupdater', url)
request.delete(url, (err, response, body) => {
console.log(
' - result of request',
err,
response && response.statusCode,
body
)
cb(err)
})
fetchStringWithResponse(url, { method: 'DELETE' }).then(
({ response, body }) => {
console.log(' - result of request: success', response.status, body)
cb()
},
err => {
console.log(' - result of request: error', err)
cb(err)
}
)
} else {
console.log('3. dry run, would request DELETE on url', url)
cb()