Commit a2e2871f authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 72d2ea52
...@@ -29,7 +29,7 @@ async function work() { ...@@ -29,7 +29,7 @@ async function work() {
if (arr.length !== 0) { if (arr.length !== 0) {
let timestamp = Date.now() let timestamp = Date.now()
try { try {
await fs.mkdirSync('last1000/' + timestamp) await fs.mkdirSync('final1000/' + timestamp)
} catch (e) { } catch (e) {
} }
...@@ -126,7 +126,7 @@ async function run(name, directory, timestamp) { ...@@ -126,7 +126,7 @@ async function run(name, directory, timestamp) {
async function readFile(name, directory) { async function readFile(name, directory) {
let sortByProfit = [] let sortByProfit = []
let file = await fs.readFileSync('./final1000/' + directory + '/' + name + '.json', 'utf8') let file = await fs.readFileSync('./last1000/' + directory + '/' + name + '.json', 'utf8')
file = JSON.parse(file) file = JSON.parse(file)
// file = _.orderBy(file, sort, ['desc']); // file = _.orderBy(file, sort, ['desc']);
for (let j = 0; j < file.length; j++) { for (let j = 0; j < file.length; j++) {
...@@ -153,7 +153,7 @@ async function readFile(name, directory) { ...@@ -153,7 +153,7 @@ async function readFile(name, directory) {
function createfileADV(timestamp, filename, data) { function createfileADV(timestamp, filename, data) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
fs.writeFile('last1000/' + timestamp + '/' + filename + '.json', data, 'utf8', function (err) { fs.writeFile('final1000/' + timestamp + '/' + filename + '.json', data, 'utf8', function (err) {
if (err) reject(err); if (err) reject(err);
else resolve(data); else resolve(data);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment