Skip to content

Commit

Permalink
Update Spring Boot and OpenBook dependency versions and improve error…
Browse files Browse the repository at this point in the history
… handling

The versions of Spring Boot and OpenBook have been updated in the pom.xml file. Additionally, the process of consuming events in ObCrankerApplication has been wrapped in a try-catch block to provide better error handling. Now, it logs any Exception thrown during processing, detailing the specific market id and error message.
  • Loading branch information
skynetcap committed May 5, 2024
1 parent 9753c6f commit 1b7c6e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
<version>3.2.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>markets.arcana</groupId>
Expand Down Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>com.mmorrell</groupId>
<artifactId>openbook</artifactId>
<version>1.30.3</version>
<version>1.30.5</version>
</dependency>
</dependencies>

Expand Down
22 changes: 16 additions & 6 deletions src/main/java/markets/arcana/obcranker/ObCrankerApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,22 @@ public void crankEventHeapLoop() {
try {
manager.cacheMarkets();
for (OpenBookMarket market : manager.getOpenBookMarkets()) {
Optional<String> transactionId = manager.consumeEvents(
finalTradingAccount,
market.getMarketId(),
8,
"Cranked by arcana.markets \uD83E\uDDD9"
);
Optional<String> transactionId = Optional.empty();
try {
transactionId = manager.consumeEvents(
finalTradingAccount,
market.getMarketId(),
8,
"Cranked by arcana.markets \uD83E\uDDD9"
);
} catch (Exception ex) {
log.error(
"Error cranking market [{}]: {}",
market.getMarketId().toBase58(),
ex.getMessage(),
ex
);
}

if (transactionId.isPresent()) {
log.info("Cranked events [{}]: {}", market.getName(), transactionId.get());
Expand Down

0 comments on commit 1b7c6e2

Please sign in to comment.