mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Added settings file to easily adjust delays
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// time in ms to wait between requesting image files
|
||||
// increase this if you see timeouts or server errors
|
||||
exports.image_file_request_delay = 500;
|
||||
|
||||
// time in ms to wait between saving Markdown files
|
||||
// increase this if your file system becomes overloaded
|
||||
exports.markdown_file_write_delay = 25;
|
||||
+3
-2
@@ -5,6 +5,7 @@ const path = require('path');
|
||||
const requestPromiseNative = require('request-promise-native');
|
||||
|
||||
const shared = require('./shared');
|
||||
const settings = require('./settings');
|
||||
|
||||
async function writeFilesPromise(posts, config) {
|
||||
await writeMarkdownFilesPromise(posts, config);
|
||||
@@ -46,7 +47,7 @@ async function writeMarkdownFilesPromise(posts, config ) {
|
||||
item: post,
|
||||
name: post.meta.slug,
|
||||
destinationPath: getPostPath(post, config),
|
||||
delay: index * 25
|
||||
delay: index * settings.markdown_file_write_delay
|
||||
}));
|
||||
|
||||
console.log('\nSaving posts...');
|
||||
@@ -78,7 +79,7 @@ async function writeImageFilesPromise(posts, config) {
|
||||
destinationPath: path.join(imagesDir, filename),
|
||||
delay
|
||||
};
|
||||
delay += 100;
|
||||
delay += settings.image_file_request_delay;
|
||||
return payload;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user