Bug Fixed
This commit is contained in:
1 parent
d2132ca808
commit
2bea1fa465
2 files changed
+25
-15
No files matched your search
+23
-13
@@ -29,13 +29,14 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
let since
|
||||
let initialProcessTimestamp
|
||||
let beginingOfMarket
|
||||
let lastFileSaved
|
||||
let lastFile
|
||||
let exchangeId
|
||||
let options = {}
|
||||
let firstId
|
||||
let rateLimit
|
||||
let exchange
|
||||
let uiStartDate = new Date(bot.uiStartDate)
|
||||
let fisrtTimeThisProcessRun = false
|
||||
|
||||
const limit = 1000
|
||||
|
||||
@@ -145,8 +146,9 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
|
||||
if (thisReport.file.beginingOfMarket !== undefined) { // This means this is not the first time this process run.
|
||||
beginingOfMarket = new Date(thisReport.file.beginingOfMarket.year + "-" + thisReport.file.beginingOfMarket.month + "-" + thisReport.file.beginingOfMarket.days + " " + thisReport.file.beginingOfMarket.hours + ":" + thisReport.file.beginingOfMarket.minutes + GMT_SECONDS);
|
||||
lastFileSaved = new Date(thisReport.file.lastFileSaved.year + "-" + thisReport.file.lastFileSaved.month + "-" + thisReport.file.lastFileSaved.days + " " + thisReport.file.lastFileSaved.hours + ":" + thisReport.file.lastFileSaved.minutes + GMT_SECONDS);
|
||||
lastFile = new Date(thisReport.file.lastFile.year + "-" + thisReport.file.lastFile.month + "-" + thisReport.file.lastFile.days + " " + thisReport.file.lastFile.hours + ":" + thisReport.file.lastFile.minutes + GMT_SECONDS);
|
||||
} else { // This means this is the first time this process run.
|
||||
fisrtTimeThisProcessRun = true
|
||||
beginingOfMarket = new Date(uiStartDate.valueOf())
|
||||
}
|
||||
|
||||
@@ -163,9 +165,9 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
initialProcessTimestamp = since
|
||||
beginingOfMarket = new Date(uiStartDate.valueOf())
|
||||
} else {
|
||||
if (lastFileSaved !== undefined) {
|
||||
since = lastFileSaved.valueOf()
|
||||
initialProcessTimestamp = lastFileSaved.valueOf()
|
||||
if (lastFile !== undefined) {
|
||||
since = lastFile.valueOf()
|
||||
initialProcessTimestamp = lastFile.valueOf()
|
||||
} else {
|
||||
since = uiStartDate.valueOf()
|
||||
initialProcessTimestamp = uiStartDate.valueOf()
|
||||
@@ -225,6 +227,14 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
let endDate = new Date(OHLCVs[OHLCVs.length - 1].timestamp)
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getOHLCVs -> OHLCVs Fetched From " + beginDate) }
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> getOHLCVs -> OHLCVs Fetched to " + endDate) }
|
||||
|
||||
if (fisrtTimeThisProcessRun === true) {
|
||||
let OHLCV = OHLCVs[0]
|
||||
|
||||
initialProcessTimestamp = OHLCV[0] // 'timestamp'
|
||||
beginingOfMarket = new Date(OHLCV[0]) // 'timestamp'
|
||||
fisrtTimeThisProcessRun = false
|
||||
}
|
||||
}
|
||||
|
||||
if (OHLCVs.length > 1) {
|
||||
@@ -434,7 +444,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
return;
|
||||
}
|
||||
filesCreated++
|
||||
lastFileSaved = new Date((currentDay * ONE_DAY))
|
||||
lastFile = new Date((currentDay * ONE_DAY))
|
||||
if (filesCreated === filesToCreate) {
|
||||
controlLoop()
|
||||
}
|
||||
@@ -474,14 +484,14 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileSt
|
||||
|
||||
function writeStatusReport() {
|
||||
try {
|
||||
if (lastFileSaved === undefined) { return }
|
||||
if (lastFile === undefined) { return }
|
||||
thisReport.file = {
|
||||
lastFileSaved: {
|
||||
year: lastFileSaved.getUTCFullYear(),
|
||||
month: (lastFileSaved.getUTCMonth() + 1),
|
||||
days: lastFileSaved.getUTCDate(),
|
||||
hours: lastFileSaved.getUTCHours(),
|
||||
minutes: lastFileSaved.getUTCMinutes()
|
||||
lastFile: {
|
||||
year: lastFile.getUTCFullYear(),
|
||||
month: (lastFile.getUTCMonth() + 1),
|
||||
days: lastFile.getUTCDate(),
|
||||
hours: lastFile.getUTCHours(),
|
||||
minutes: lastFile.getUTCMinutes()
|
||||
},
|
||||
beginingOfMarket: {
|
||||
year: beginingOfMarket.getUTCFullYear(),
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="Historic-OHLCV\User.Bot.js">
|
||||
<Compile Include="Historic-OHLCVs\User.Bot.js">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Historic-Trades\User.Bot.js" />
|
||||
@@ -26,7 +26,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Historic-Trades\" />
|
||||
<Folder Include="Historic-OHLCV\" />
|
||||
<Folder Include="Historic-OHLCVs\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
|
||||
|
||||
Reference in new issue
Block a user