zeripath
b62e13a001
Open transaction when adding Avatar email-hash pairs to the DB ( #12577 ) ( #12940 )
...
Backport #12577
When adding Avatar email-hash pairs we simply want the DB table to
represent a Set. We don't care if the hash-pair is already present,
so we just simply Insert and ignore the error.
Unfortunately this seems to cause some DBs to log the duplicate
insert to their logs - looking like a bug a in Gitea.
Now, there is no standard way in SQL to say Insert but if there's
an error ignore it. MySQL has INSERT IGNORE, PostgreSQL >= 9.5 has
INSERT ... ON CONFLICT DO NOTHING, but I do not believe that SQLite
or MSSQL have variants.
This PR places the insert in a transaction which we are happy to fail
if there is an error - hopefully this will stop the unnecessary
logging.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-09-24 18:36:26 -04:00
..
2020-05-02 03:20:51 +03:00
2020-09-16 10:37:04 +03:00
2020-02-15 12:29:06 +08:00
2020-03-22 11:12:55 -04:00
2020-04-05 07:20:50 +01:00
2020-02-27 20:10:27 -03:00
2020-05-16 19:31:38 -04:00
2020-02-18 21:36:19 -03:00
2020-06-18 10:06:48 -04:00
2020-09-24 18:36:26 -04:00
2020-08-22 23:35:56 +03:00
2020-01-22 11:46:04 +08:00
2020-01-24 14:00:29 -05:00
2020-06-11 17:08:13 -04:00
2020-01-20 20:01:19 +00:00
2019-08-24 11:24:45 +02:00
2020-05-16 19:31:38 -04:00
2020-01-23 19:28:15 +02:00
2020-02-15 10:59:43 +02:00
2020-02-15 10:59:43 +02:00
2019-08-15 22:46:21 +08:00
2020-08-17 12:06:31 -04:00
2019-12-13 23:21:06 +01:00
2020-02-03 09:47:04 +01:00
2019-11-10 16:07:21 +08:00
2020-03-02 00:05:44 +02:00
2020-01-21 10:18:52 +00:00
2020-06-18 18:22:43 +03:00
2019-12-15 16:57:34 -05:00
2019-08-15 22:46:21 +08:00
2020-04-28 19:28:56 -04:00
2020-06-17 20:53:43 +01:00
2020-04-01 01:14:46 -03:00
2020-04-16 13:44:34 +03:00
2019-12-16 11:54:24 +08:00
2020-05-12 22:54:35 +01:00
2020-05-12 22:54:35 +01:00
2020-01-15 12:14:07 +01:00
2020-01-24 14:00:29 -05:00
2020-04-05 07:20:50 +01:00
2020-01-24 14:00:29 -05:00
2020-02-29 03:52:05 -03:00
2019-12-27 20:30:58 +00:00
2020-05-09 11:18:44 -03:00
2020-01-17 08:03:40 +02:00
2019-10-25 22:46:37 +08:00
2020-01-24 14:00:29 -05:00
2020-04-21 14:48:53 +01:00
2019-12-15 16:57:34 -05:00
2019-12-16 11:54:24 +08:00
2020-09-03 17:23:36 +08:00
2019-12-12 21:18:07 +08:00
2020-04-05 07:20:50 +01:00
2020-06-10 13:42:10 -04:00
2020-03-22 11:12:55 -04:00
2020-06-17 20:53:43 +01:00
2020-04-05 07:20:50 +01:00
2020-04-17 20:42:57 +03:00
2020-09-07 20:44:45 -04:00
2020-09-07 20:44:45 -04:00
2020-04-06 19:33:34 +03:00
2020-07-13 21:52:05 +01:00
2020-06-18 10:06:48 -04:00
2020-05-10 17:55:22 +03:00
2020-01-24 14:00:29 -05:00
2020-04-07 22:52:01 +01:00
2020-02-04 16:27:18 +02:00
2020-08-17 09:32:33 +03:00
2020-01-24 14:00:29 -05:00
2020-08-22 16:22:07 +01:00
2020-03-02 22:31:55 +00:00
2020-04-14 09:53:34 -04:00
2020-04-18 11:47:15 -03:00
2020-01-20 12:07:30 +02:00
2020-01-14 11:38:04 +08:00
2020-01-24 14:00:29 -05:00
2020-04-07 22:52:01 +01:00
2019-11-30 01:54:47 -05:00
2020-01-24 14:00:29 -05:00
2020-02-14 13:42:30 +01:00
2020-06-02 20:55:21 +03:00
2020-01-24 14:00:29 -05:00
2020-05-21 08:23:20 -05:00
2019-12-14 18:30:01 +01:00
2020-04-07 22:52:01 +01:00
2019-12-06 12:00:50 +08:00
2019-12-06 12:00:50 +08:00
2020-01-26 23:44:12 +00:00
2020-07-08 17:52:40 -04:00
2020-03-22 11:12:55 -04:00
2020-01-24 14:00:29 -05:00
2020-02-26 03:32:22 -03:00
2020-07-08 17:52:40 -04:00
2020-05-02 03:20:51 +03:00
2020-09-16 10:37:04 +03:00
2019-11-03 19:08:18 +08:00
2020-04-06 11:44:47 +01:00
2020-01-24 14:00:29 -05:00
2020-01-24 14:00:29 -05:00
2020-01-12 20:11:17 +08:00
2020-03-22 11:12:55 -04:00
2020-04-13 22:02:48 +03:00
2020-06-18 10:06:48 -04:00
2020-01-24 14:00:29 -05:00
2020-01-31 08:57:19 +02:00
2020-06-17 20:53:43 +01:00
2020-04-05 07:20:50 +01:00
2019-08-15 22:46:21 +08:00
2020-03-22 11:12:55 -04:00
2020-01-17 09:34:37 +02:00
2020-03-02 00:05:44 +02:00
2020-06-18 10:06:48 -04:00
2020-04-05 07:20:50 +01:00
2020-01-13 18:33:46 +01:00
2019-08-24 11:24:45 +02:00
2020-03-02 15:25:36 -03:00
2020-06-17 20:53:43 +01:00
2020-06-17 20:53:43 +01:00
2020-09-10 11:32:54 +03:00
2020-09-10 11:32:54 +03:00
2019-11-20 19:27:49 +08:00
2020-01-24 14:00:29 -05:00
2020-03-06 07:10:48 +02:00
2020-06-18 10:06:48 -04:00
2020-01-07 18:27:36 +00:00
2020-01-12 17:36:21 +08:00