Skip to content

Commit

Permalink
Disable export if autorefresh is enabled
Browse files Browse the repository at this point in the history
Currently it's setup only for one time export.  The first refresh
produces errors about a closed file.
Also, given both index and symbol data is in the same file, it would
get all mixed up with auto-appending.  Need to correct this in the
future.
  • Loading branch information
frossm committed Aug 18, 2023
1 parent 99bfd61 commit 61427ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.fross</groupId>
<artifactId>quoter</artifactId>
<version>5.0.21</version>
<version>5.0.22</version>
<packaging>jar</packaging>

<name>quoter</name>
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: quoter
version: '5.0.21'
version: '5.0.22'
summary: Command line utility to pull stock and index quotes
description: |
Quoter fetches online stock quotes and index data for easy display on
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/fross/quoter/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ public static void main(String[] args) {

// Auto-refresh is enabled. Re-display the data every cli.clAutoRefresh seconds
if (cli.clAutoRefresh > 0) {
// Ensure export is not turned on as it will fail after the first iteration
// TODO: Maybe split index info and symbol info and keep updating each file? Fix this.
if (!cli.clExport.isEmpty()) {
Output.printColor(Ansi.Color.RED, "\nExport not compatable for for refreshed values. Disabling...\n");
cli.clExport = "";
}

// Continuous loop displaying the output until user hits enter. The EnterPressed thread picks that up and exits the program
while (true) {
int countDown = cli.clAutoRefresh;
Expand Down

0 comments on commit 61427ef

Please sign in to comment.