Skip to content

Commit

Permalink
load last update time from disk if any
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Nov 18, 2024
1 parent dd3c700 commit e545d05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/main/java/ru/r2cloud/satellite/SatelliteDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ private static List<Satellite> loadFromConfig(Path metaLocation, SatelliteSource
continue;
}
cur.setSource(source);
cur.setLastUpdateTime(lastUpdateTime);
if (cur.getLastUpdateTime() == 0) {
cur.setLastUpdateTime(lastUpdateTime);
}
result.add(cur);
}
return result;
Expand Down
6 changes: 0 additions & 6 deletions src/test/java/ru/r2cloud/it/util/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@
import java.net.InetSocketAddress;
import java.net.http.HttpResponse;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
import java.util.Properties;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.logging.LogManager;

import org.junit.After;
Expand Down Expand Up @@ -176,8 +172,6 @@ protected Configuration prepareConfiguration() throws IOException {
w.append("ittests");
}
config.setProperty("server.keyword.location", setupKeyword.getAbsolutePath());
Path p = config.getPathFromProperty("satellites.meta.location");
Files.setLastModifiedTime(p, FileTime.from(1719525695573L, TimeUnit.MILLISECONDS));
return config;
}

Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/satellites-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,8 @@
"frequency": 137620000,
"bandwidth": 34000
}
]
],
"lastUpdateTime": 1719525695573
},
{
"name": "SWAMPSAT-2",
Expand Down

0 comments on commit e545d05

Please sign in to comment.