mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 05:17:35 +00:00
feat: configurable status code behaviours (#340)
This commit is contained in:
+3
-3
@@ -26,12 +26,12 @@ export const Logger = winston.createLogger({
|
||||
});
|
||||
|
||||
export const Print = {
|
||||
backoff(link: Link, store: Store, delay: number, color?: boolean): string {
|
||||
backoff(link: Link, store: Store, parameters: {delay: number; statusCode: number}, color?: boolean): string {
|
||||
if (color) {
|
||||
return '✖ ' + buildProductString(link, store, true) + ' :: ' + chalk.yellow(`REQUEST FORBIDDEN - BACKOFF DELAY ${delay}`);
|
||||
return '✖ ' + buildProductString(link, store, true) + ' :: ' + chalk.yellow(`BACKOFF DELAY status=${parameters.statusCode} delay=${parameters.delay}`);
|
||||
}
|
||||
|
||||
return `✖ ${buildProductString(link, store)} :: REQUEST FORBIDDEN - BACKOFF DELAY ${delay}`;
|
||||
return `✖ ${buildProductString(link, store)} :: BACKOFF DELAY status=${parameters.statusCode} delay=${parameters.delay}`;
|
||||
},
|
||||
badStatusCode(link: Link, store: Store, statusCode: number, color?: boolean): string {
|
||||
if (color) {
|
||||
|
||||
Reference in New Issue
Block a user