Create a simulation to test 1 month of data in 30 mins

This commit is contained in:
2026-03-11 21:33:19 -07:00
parent 9b5ebb4140
commit d5df9d1014
6 changed files with 156 additions and 9 deletions
+7 -4
View File
@@ -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)){