mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-23 21:09:53 +02:00
Apply workaround for earlyExit
This commit is contained in:
parent
3185ecfd61
commit
01229828ff
8 changed files with 192 additions and 144 deletions
102
dist/save/index.js
vendored
102
dist/save/index.js
vendored
|
@ -59347,37 +59347,6 @@ var Events;
|
|||
exports.RefKey = "GITHUB_REF";
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5131:
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const saveImpl_1 = __importDefault(__nccwpck_require__(6589));
|
||||
const stateProvider_1 = __nccwpck_require__(1527);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield (0, saveImpl_1.default)(new stateProvider_1.StateProvider());
|
||||
});
|
||||
}
|
||||
run();
|
||||
exports["default"] = run;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6589:
|
||||
|
@ -59418,9 +59387,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.saveRun = exports.saveOnlyRun = exports.saveImpl = void 0;
|
||||
const cache = __importStar(__nccwpck_require__(7799));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const constants_1 = __nccwpck_require__(9042);
|
||||
const stateProvider_1 = __nccwpck_require__(1527);
|
||||
const utils = __importStar(__nccwpck_require__(6850));
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||
|
@ -59467,7 +59438,54 @@ function saveImpl(stateProvider) {
|
|||
return cacheId;
|
||||
});
|
||||
}
|
||||
exports["default"] = saveImpl;
|
||||
exports.saveImpl = saveImpl;
|
||||
function saveOnlyRun(earlyExit) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const cacheId = yield saveImpl(new stateProvider_1.NullStateProvider());
|
||||
if (cacheId === -1) {
|
||||
core.warning(`Cache save failed.`);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
if (earlyExit) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// node will stay alive if any promises are not resolved,
|
||||
// which is a possibility if HTTP requests are dangling
|
||||
// due to retries or timeouts. We know that if we got here
|
||||
// that all promises that we care about have successfully
|
||||
// resolved, so simply exit with success.
|
||||
if (earlyExit) {
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.saveOnlyRun = saveOnlyRun;
|
||||
function saveRun(earlyExit) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
yield saveImpl(new stateProvider_1.StateProvider());
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
if (earlyExit) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
// node will stay alive if any promises are not resolved,
|
||||
// which is a possibility if HTTP requests are dangling
|
||||
// due to retries or timeouts. We know that if we got here
|
||||
// that all promises that we care about have successfully
|
||||
// resolved, so simply exit with success.
|
||||
if (earlyExit) {
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.saveRun = saveRun;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -59855,12 +59873,18 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
|||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module is referenced by other modules so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __nccwpck_require__(5131);
|
||||
/******/ module.exports = __webpack_exports__;
|
||||
/******/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||
(() => {
|
||||
"use strict";
|
||||
var exports = __webpack_exports__;
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const saveImpl_1 = __nccwpck_require__(6589);
|
||||
(0, saveImpl_1.saveRun)(true);
|
||||
|
||||
})();
|
||||
|
||||
module.exports = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
Loading…
Add table
Add a link
Reference in a new issue