fix: результат редактирования не появлялся в окне «Результат появится здесь» — корень: браузер кэшировал ответ /api/jobs/:id/status со статусом «running» (не было Cache-Control), и последний финальный запрос получал stale-ответ с result=null
All checks were successful
test / test (push) Successful in 10s
All checks were successful
test / test (push) Successful in 10s
This commit is contained in:
@@ -14,6 +14,7 @@ function createJobsRoutes({ jobService }) {
|
||||
|
||||
router.get("/jobs", (req, res, next) => {
|
||||
try {
|
||||
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
res.json({ ok: true, jobs: jobService.listJobs() });
|
||||
} catch (err) {
|
||||
next(err);
|
||||
@@ -22,6 +23,7 @@ function createJobsRoutes({ jobService }) {
|
||||
|
||||
router.get("/jobs/:id/status", (req, res, next) => {
|
||||
try {
|
||||
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
const { id } = req.params;
|
||||
if (!JOB_ID_PATTERN.test(id)) {
|
||||
throw new BadRequestError("Некорректный идентификатор задания.");
|
||||
|
||||
Reference in New Issue
Block a user