Исправлены баги с рассылкой и размножением сообщений.
This commit is contained in:
2025-03-08 15:56:34 +03:00
parent e123600e06
commit f3747a359b
11 changed files with 203 additions and 152 deletions

View File

@@ -60,18 +60,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//------>>>
public static Timer checkTimer = null;
public String name = "?";
DVMTestingChecker dvmTestingChecker = new DVMTestingChecker();
SapforTestingPlanner sapforTestingPlanner = new SapforTestingPlanner();
DVMTestingChecker dvmTestingChecker = null;
SapforTestingPlanner sapforTestingPlanner = null;
//-->
MachinesDatabase machines_db;
//-->
protected Thread testingThread = new Thread(() -> {
while (true) {
dvmTestingChecker.Perform();
sapforTestingPlanner.Perform();
Utils_.sleep(5000);
}
});
public TestingServer() {
super(TestsDatabase.class);
name = Utils_.getDateName("testingServer");
@@ -87,10 +80,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
@Override
protected void extraBackup(File todayBackUp) {
zip.Do("Tests", new File (todayBackUp, "Tests.zip").getAbsolutePath());
zip.Do("Sapfors", new File (todayBackUp, "Sapfors.zip").getAbsolutePath());
zip.Do("DVMPackages", new File (todayBackUp, "DVMPackages.zip").getAbsolutePath());
zip.Do("SapforPackages", new File (todayBackUp, "SapforPackages.zip").getAbsolutePath());
zip.Do("Tests", new File(todayBackUp, "Tests.zip").getAbsolutePath());
zip.Do("Sapfors", new File(todayBackUp, "Sapfors.zip").getAbsolutePath());
zip.Do("DVMPackages", new File(todayBackUp, "DVMPackages.zip").getAbsolutePath());
zip.Do("SapforPackages", new File(todayBackUp, "SapforPackages.zip").getAbsolutePath());
}
public static void TimerOn() {
checkTimer = new Timer(Global.normalProperties.CheckTestingIntervalSeconds * 1000, e -> {
@@ -294,7 +287,15 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
@Override
protected void startAdditionalThreads() {
testingThread.start();
dvmTestingChecker = new DVMTestingChecker();
sapforTestingPlanner = new SapforTestingPlanner();
new Thread(() -> {
while (true) {
dvmTestingChecker.Perform();
sapforTestingPlanner.Perform();
Utils_.sleep(5000);
}
}).start();
}
void PerformAutoSapforTesting() throws Exception {
TextLog Log = new TextLog();
@@ -307,9 +308,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
Log.toString()
);
for (String address : Constants.admins_mails) {
Email(message, address);
}
for (String address : Constants.admins_mails)
EmailMessagesQueue.add(new Pair<>(address,message));
}
void DownloadTest() throws Exception {
int test_id = Integer.parseInt(request.arg);