jsdelivr / globalping

A global network of probes to run network tests like ping, traceroute and DNS resolve
https://globalping.io
274 stars 33 forks source link

fix: update UUID only if it changed #570

Closed MartinKolarik closed 2 weeks ago

MartinKolarik commented 2 weeks ago

Most likely as a result of https://github.com/jsdelivr/globalping-dash-directus/commit/ce54f8e61bec9faf5fb988ee49a329f05eacc47b, the sync is now failing with this error:

update `gp_adopted_probes` set `ip` = 'xxx', `altIps` = '[\"yyy\"]', `uuid` = 'zzz' where `ip` = 'xxx' - ER_DUP_ENTRY: Duplicate entry 'zzz' for key 'gp_adopted_probes_uuid_unique'

To avoid it, we must either not try to update the UUID without changing its value, or include the value in the WHERE part as well.