Skip to content

Commit

Permalink
Preparing Backgroundog
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Sep 19, 2023
1 parent b97cf92 commit 10a9bdd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/Project/Sucrose.Backgroundog/Extension/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public static JObject GetDateInfo()

return new JObject
{
{ "Year", Date.Year },
{ "Month", Date.Month },
{ "Day", Date.Day },
{ "Hour", Date.Hour },
{ "Year", Date.Year },
{ "Month", Date.Month },
{ "Minute", Date.Minute },
{ "Second", Date.Second },
{ "Millisecond", Date.Millisecond }
Expand Down
27 changes: 10 additions & 17 deletions src/Project/Sucrose.Backgroundog/Helper/Attempt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,23 @@ internal static class Attempt
{
public static async Task Start()
{
Console.WriteLine("Deneme");
int MaxAttempts = 5;
bool Success = false;
int IntervalInSeconds = 1;
int IntervalSeconds = 1;

for (int Attempt = 0; Attempt <= MaxAttempts; Attempt++)
for (int Attempt = 0; Attempt < MaxAttempts; Attempt++)
{
Success = SSSHL.Run();

if (Success)
if (SSSHL.Run())
{
Console.WriteLine("İşlem başarılı!");
break;
return;
}

await Task.Delay(IntervalInSeconds * 1000);
await Task.Delay(TimeSpan.FromSeconds(IntervalSeconds));
}

if (!Success)
{
SBMI.Exit = false;
SBMI.Initialize.Stop();
Console.WriteLine("İşlem başarısız oldu ve 5 deneme sonunda hala true dönmedi.");
}
SBMI.Exit = false;
SBMI.Initialize.Stop();

await Task.CompletedTask;
}
}
}
}
2 changes: 2 additions & 0 deletions src/Project/Sucrose.Backgroundog/Helper/Condition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public static async Task Start()
Console.WriteLine("Condition");
//Performans şartları sağlanıp live motoru kapatıldıysa veya durdurulduysa
//Live motoruna gRPC (Live.json) ile durdur mesajı gönderilir

await Task.CompletedTask;
}
}
}
2 changes: 1 addition & 1 deletion src/Project/Sucrose.Backgroundog/Helper/Initialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ public void Dispose()
GC.SuppressFinalize(this);
}
}
}
}
4 changes: 3 additions & 1 deletion src/Project/Sucrose.Backgroundog/Helper/Performance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public static async Task Start()
{
Console.WriteLine("Run");
//Performans şartları kontrol edilecek...

await Task.CompletedTask;
}
}
}
}
2 changes: 0 additions & 2 deletions src/Project/Sucrose.Backgroundog/Helper/Specification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public static async Task Start()
{
if (SBMI.Exit)
{
Console.WriteLine("Specification");

SBMI.Computer.Accept(new UpdateVisitor());

foreach (IHardware Hardware in SBMI.Computer.Hardware)
Expand Down

0 comments on commit 10a9bdd

Please sign in to comment.