Commit a2e2871f authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 72d2ea52
......@@ -29,7 +29,7 @@ async function work() {
if (arr.length !== 0) {
let timestamp = Date.now()
try {
await fs.mkdirSync('last1000/' + timestamp)
await fs.mkdirSync('final1000/' + timestamp)
} catch (e) {
}
......@@ -126,7 +126,7 @@ async function run(name, directory, timestamp) {
async function readFile(name, directory) {
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 = _.orderBy(file, sort, ['desc']);
for (let j = 0; j < file.length; j++) {
......@@ -153,7 +153,7 @@ async function readFile(name, directory) {
function createfileADV(timestamp, filename, data) {
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);
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