Skip to content
Snippets Groups Projects
Commit 1bdfb0ae authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

only update profile is new timestamp is higher

prevents older data to modify newer data
parent 12963eb9
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ export async function setLatestIndexedCID(cid: CID) {
}
// cesium plus profile query and param builder
// completely overwrites previous data
// completely overwrites previous data if new timestamp is higher
const cesiumPlusProfile: QueryBuilder = {
query: `INSERT INTO
profiles(index_request_cid, time, pubkey, data_cid, title, description, avatar, geoloc, city, socials)
......@@ -88,6 +88,7 @@ const cesiumPlusProfile: QueryBuilder = {
geoloc = EXCLUDED.geoloc,
city = EXCLUDED.city,
socials = EXCLUDED.socials;
WHERE EXCLUDED.time > profiles.time;
`,
dataGetter: defaultDataGetter,
dataTransform: defaultDataTransform,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment