aboutsummaryrefslogtreecommitdiffstats
path: root/lib/locations.ts
diff options
context:
space:
mode:
authorDedan Kibere <[email protected]>2024-10-27 23:05:49 +0300
committerGitHub <[email protected]>2024-10-27 23:05:49 +0300
commit87059fe805d3372263d26b391f8855139f84ad34 (patch)
tree7099fbce72e7614c0c689d2f9a62e69f8b2e621a /lib/locations.ts
parent041db323e4c23d87663bc29519af604137f3eb42 (diff)
parentd09712ef8f8ea8218ce229b233fc0013e6c06f7a (diff)
downloadcoinos-server-87059fe805d3372263d26b391f8855139f84ad34.tar.gz
coinos-server-87059fe805d3372263d26b391f8855139f84ad34.zip
Merge branch 'coinos:master' into master
Diffstat (limited to 'lib/locations.ts')
-rw-r--r--lib/locations.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/locations.ts b/lib/locations.ts
index 560d5259..11981c19 100644
--- a/lib/locations.ts
+++ b/lib/locations.ts
@@ -1,7 +1,7 @@
import { err } from "$lib/logging";
import got from "got";
import { g, s } from "$lib/db";
-import { fields, pick } from "$lib/utils";
+import { fields, pick, uniq } from "$lib/utils";
export let getLocations = async () => {
try {
@@ -40,7 +40,10 @@ export let getLocations = async () => {
locations.push(...previous);
- await s("locations", locations);
+ await s(
+ "locations",
+ uniq(locations, (l) => l.id),
+ );
await s("locations:since", new Date().toISOString().split(".")[0] + "Z");
} catch (e) {
err("problem fetching locations", e);