Create a simulation to test 1 month of data in 30 mins
This commit is contained in:
@@ -17,14 +17,17 @@ namespace Controllers.Automation {
|
||||
_paymentProcessor = PaymentProcessor;
|
||||
}
|
||||
|
||||
public void GlobalPredictAI() {
|
||||
public void GlobalPredictAI(int DaysBefore = 0, bool testmode = false) {
|
||||
|
||||
// Start this process on a background thread so its non-blocking
|
||||
Task thread = new Task(() => {
|
||||
|
||||
// Load the userlist
|
||||
List<string>? UserList = JsonConvert.DeserializeObject<List<string>>(_dbDriver.Get("Users"));
|
||||
List<string> VerifiedUserList = UserList != null ? UserList : new List<string>();
|
||||
List<string> VerifiedUserList = new List<string>(){ "TESTMODE" };
|
||||
if (!testmode) {
|
||||
List<string>? UserList = JsonConvert.DeserializeObject<List<string>>(_dbDriver.Get("Users"));
|
||||
VerifiedUserList = UserList != null ? UserList : new List<string>();
|
||||
}
|
||||
|
||||
// Process each request at the same time for speed improvement
|
||||
Parallel.ForEach(VerifiedUserList, async (username) => {
|
||||
@@ -40,7 +43,7 @@ namespace Controllers.Automation {
|
||||
|
||||
// Predict the trend on a new thread
|
||||
Task thread = new Task(() => {
|
||||
(string, float)Result = _aiModule.PredictAI(cur.Symbol);
|
||||
(string, float)Result = _aiModule.PredictAI(cur.Symbol, DaysBefore);
|
||||
|
||||
// If error log it
|
||||
if (!string.IsNullOrEmpty(Result.Item1)){
|
||||
|
||||
Reference in New Issue
Block a user