Reduce timing for quicker responces

This commit is contained in:
James 2022-02-06 18:07:20 -08:00
parent 44ec02c0af
commit a24c8c73b2
8 changed files with 12 additions and 13 deletions

View File

@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Server" type="Application" factoryName="Application"> <configuration default="false" name="Server" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.jamesquinley.startup" /> <option name="MAIN_CLASS_NAME" value="com.jamesquinley.init" />
<module name="AOTSK-Login-Delegation-Server" /> <module name="AOTSK-Login-Delegation-Server" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />

View File

@ -134,7 +134,7 @@
<addClasspath>true</addClasspath> <addClasspath>true</addClasspath>
<!-- Specifies that all dependencies of our application are found --> <!-- Specifies that all dependencies of our application are found -->
<!-- Configures the main class of the application --> <!-- Configures the main class of the application -->
<mainClass>com.jamesquinley.startup</mainClass> <mainClass>com.jamesquinley.init</mainClass>
</manifest> </manifest>
</archive> </archive>
</configuration> </configuration>

View File

@ -1,3 +1,3 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Main-Class: com.jamesquinley.startup Main-Class: com.jamesquinley.init

View File

@ -48,7 +48,7 @@ public class delegationServices {
System.out.println("Delegation Has Started"); System.out.println("Delegation Has Started");
if(requesttype == 0 || requesttype == 1 || requesttype == 2 || requesttype == 3 || requesttype == 4 || requesttype == 5 || requesttype == 6 || requesttype ==7 || requesttype == 8 || requesttype ==9 || requesttype ==10 || requesttype ==11 || requesttype ==12) { if(requesttype == 0 || requesttype == 1 || requesttype == 2 || requesttype == 3 || requesttype == 4 || requesttype == 5 || requesttype == 6 || requesttype ==7 || requesttype == 8 || requesttype ==9 || requesttype ==10 || requesttype ==11 || requesttype ==12) {
if (requesttype == 7) { if (requesttype == 7 || requesttype == 12) {
System.out.println("An Excluded Request (7MAL) Has Been Detected, Ignoring"); System.out.println("An Excluded Request (7MAL) Has Been Detected, Ignoring");
} }

View File

@ -9,11 +9,11 @@ public class delegationTimer {
{ {
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable runnable = new Runnable() { final Runnable runnable = new Runnable() {
int countdownStarter = 5; int countdownStarter = 1;
public void run() { public void run() {
countdownStarter--; countdownStarter--;
if (countdownStarter <= 0) { if (countdownStarter <= 0) {
countdownStarter = 5; countdownStarter = 1;
delegationServices.delegate(); delegationServices.delegate();
scheduler.shutdown(); scheduler.shutdown();
} }
@ -25,12 +25,13 @@ public class delegationTimer {
{ {
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable runnable = new Runnable() { final Runnable runnable = new Runnable() {
int countdownStarter = 60; int countdownStarter = 15;
public void run() { public void run() {
countdownStarter--; countdownStarter--;
if (countdownStarter <= 0) { if (countdownStarter <= 0) {
countdownStarter = 60; countdownStarter = 15;
delegationServices.Clear(); delegationServices.Clear();
//flushes all requests from the server
scheduler.shutdown(); scheduler.shutdown();
} }
} }

View File

@ -1,20 +1,18 @@
package com.jamesquinley; package com.jamesquinley;
import com.jamesquinley.DelegationServices.delegationServices;
import static com.jamesquinley.DelegationServices.delegationTimer.DeleteAllRequests; import static com.jamesquinley.DelegationServices.delegationTimer.DeleteAllRequests;
/** /**
Hey there! This is the source code for AOTSK-Delegation Server, for login Hey there! This is the source code for AOTSK-Delegation Server, for login
* *
*/ */
public class startup public class init
{ {
public static void main( String[] args ) public static void main( String[] args )
{ {
System.out.println( "We're starting the login delegation server, please wait one moment while we check a few things."); System.out.println( "We're starting the login delegation server, please wait one moment while we check a few things.");
com.jamesquinley.DelegationServices.delegationTimer.trigger(); com.jamesquinley.DelegationServices.delegationTimer.trigger();
// DeleteAllRequests(); DeleteAllRequests();
System.out.println("We've started everything, requests are now being served"); System.out.println("We've started everything, requests are now being served");
} }
} }

View File

@ -1,5 +1,5 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Main-Class: com.jamesquinley.startup Main-Class: com.jamesquinley.init
Class-Path: bson-4.3.2.jar junit-4.10.jar jsoup-1.14.2.jar zip4j-2.6.1.j Class-Path: bson-4.3.2.jar junit-4.10.jar jsoup-1.14.2.jar zip4j-2.6.1.j
ar controlsfx-11.1.1.jar mongodb-driver-sync-4.3.2.jar log4j-api-2.17.0 ar controlsfx-11.1.1.jar mongodb-driver-sync-4.3.2.jar log4j-api-2.17.0
.jar log4j-core-2.17.0.jar jfoenix-8.0.10.jar mongodb-driver-core-4.3.2 .jar log4j-core-2.17.0.jar jfoenix-8.0.10.jar mongodb-driver-core-4.3.2