-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade dependencies * Adapt to new api * Migrate to mui 5 npx @mui/codemod v5.0.0/preset-safe . * Migrate to mui 5 * Cleanup dependencies * Deactivate dependabot * Fix dependencies * Upgrade GH actions * Remove unknown eslint rule * Upgrade dependencies for infrastructure * Upgrade backend dependencies * Fix typo * Replace javax with jakarta annotations * Enable snapstart for lambdas * Fix linter warning --------- Co-authored-by: kaklakariada <kaklakariada@users.noreply.github.com>
- Loading branch information
1 parent
4402a27
commit 128a32a
Showing
13 changed files
with
164 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
backend/src/main/java/org/itsallcode/aws/ec2/SnapStartCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.itsallcode.aws.ec2; | ||
|
||
import java.util.List; | ||
|
||
import org.crac.Context; | ||
import org.crac.Resource; | ||
import org.itsallcode.aws.ec2.model.SimpleInstance; | ||
import org.itsallcode.aws.ec2.service.InstanceService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.micronaut.crac.OrderedResource; | ||
import jakarta.inject.Inject; | ||
|
||
public class SnapStartCallback implements OrderedResource | ||
{ | ||
private static final Logger LOG = LoggerFactory.getLogger(SnapStartCallback.class); | ||
|
||
private final InstanceService instanceService; | ||
|
||
@Inject | ||
public SnapStartCallback(final InstanceService instanceService) | ||
{ | ||
this.instanceService = instanceService; | ||
} | ||
|
||
@Override | ||
public void beforeCheckpoint(final Context<? extends Resource> context) | ||
{ | ||
LOG.info("Before checkpoint"); | ||
try | ||
{ | ||
final List<SimpleInstance> instances = instanceService.list(); | ||
LOG.info("Found {} instances", instances.size()); | ||
} | ||
catch (final Exception e) | ||
{ | ||
LOG.warn("Failed to initialize lambda", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void afterRestore(final Context<? extends Resource> context) | ||
{ | ||
LOG.info("After restore"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.