Skip to content
Snippets Groups Projects
Commit 8749130d authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

clean

parent 9d9f503f
No related branches found
No related tags found
1 merge request!806AWS Lambda
package gov.usgs.earthquake.nshmp.www;
import java.nio.file.Path;
import java.util.logging.Logger;
import org.crac.Context;
import org.crac.Resource;
......@@ -28,14 +27,12 @@ public class PrimingResource implements OrderedResource {
@Override
public void beforeCheckpoint(Context<? extends Resource> context) throws Exception {
Logger.getAnonymousLogger().info("Before checkpoint");
ServletUtil.model(ServletUtil.loadModel(modelPath));
updateParameter();
}
@Override
public void afterRestore(Context<? extends Resource> context) throws Exception {
Logger.getAnonymousLogger().info("After restore: reset execurors");
// Reset executors on restore as Shutdown event does not fire on AWS lambda
ServletUtil.resetExecutors();
}
......
......@@ -112,14 +112,12 @@ public class ServletUtil {
@EventListener
void shutdown(ShutdownEvent event) {
java.util.logging.Logger.getAnonymousLogger().info("shutdown");
CALC_EXECUTOR.shutdown();
TASK_EXECUTOR.shutdown();
}
@EventListener
void startup(StartupEvent event) {
java.util.logging.Logger.getAnonymousLogger().info("startup");
if (!awsRuntime.isPresent()) {
HAZARD_MODEL = loadModel(modelPath);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment