Skip to content

Commit

Permalink
chore: Added JVM settings env variable. Rename app class
Browse files Browse the repository at this point in the history
  • Loading branch information
satran004 committed Jan 22, 2024
1 parent 5c4c60a commit 970caf2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Build docker image


```shell
docker build -t cardanofoundation/ledger-sync:<version> .
docker build --target ledger-sync -t cardanofoundation/ledger-sync:<version> .
```

### Docker Run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.cardanofoundation.ledgersync.explorerconsumer;

import jakarta.annotation.PostConstruct;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
Expand All @@ -17,15 +18,21 @@
@ComponentScan(basePackages = "org.cardanofoundation.*")
@EntityScan("org.cardanofoundation.*")
@EnableJpaRepositories("org.cardanofoundation.*")
public class ExplorerConsumerApplication {
public class LedgerSyncApplication {

static {
System.setProperty("org.jooq.no-logo", "true");
System.setProperty("org.jooq.no-tips", "true");
}

public static void main(String[] args) {
SpringApplication.run(ExplorerConsumerApplication.class, args);
SpringApplication.run(LedgerSyncApplication.class, args);
}

@PostConstruct
public void postConstruct() {
long maxMemory = Runtime.getRuntime().maxMemory();
log.info("<< Max JVM heap memory: {} MB", maxMemory / (1024 * 1024) + " >>");
}

}
3 changes: 2 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ SPRING_DATASOURCE_USERNAME=user
SPRING_DATASOURCE_PASSWORD=
SCHEMA=cexplorer


#Set min and max heap size if required
#JDK_JAVA_OPTIONS=-Xms4G -Xmx12G

0 comments on commit 970caf2

Please sign in to comment.