convert-slow-api
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -95,3 +95,3 @@ "use strict"; | ||
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(req, res) { | ||
var id, cacheKey, cached; | ||
var id, cacheKey, cached, finished; | ||
return _regenerator["default"].wrap(function _callee2$(_context2) { | ||
@@ -132,6 +132,13 @@ while (1) { | ||
res.json(cached); | ||
_context2.next = 13; | ||
finished = cached.finished; | ||
if (!finished) { | ||
_context2.next = 15; | ||
break; | ||
} | ||
_context2.next = 15; | ||
return _cache["default"].del(cacheKey); | ||
case 13: | ||
case 15: | ||
case "end": | ||
@@ -138,0 +145,0 @@ return _context2.stop(); |
{ | ||
"name": "convert-slow-api", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/get-router.js", |
@@ -49,7 +49,13 @@ import { Router } from 'express' | ||
let cached = await cache.get(cacheKey) | ||
if (!cached) return res.json({ | ||
error: `id=${id} job not found`, | ||
}) | ||
res.json(cached) | ||
await cache.del(cacheKey) | ||
const { finished } = cached | ||
if (finished) { | ||
await cache.del(cacheKey) | ||
} | ||
}) | ||
@@ -56,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14178
380