Commit Graph

11 Commits

Author SHA1 Message Date
Kiril Vladimiroff
d5dbe546e4
Always defer *sql.Rows.Close and consult with Err (#844)
* Always defer *sql.Rows.Close and consult with Err

database/sql.Rows.Next() makes sure to call Close only after exhausting
result rows which would NOT happen when returning early from a bad Scan.
Close being idempotent makes it a great candidate to get always deferred
regardless of what happens later on the result set.

This change also makes sure call Err() after exhausting Next() and
propagate non-nil results from it as the documentation advises.

Closes #764

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>

* Override named result parameters in last returns

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>

* Do the same over new changes that got merged

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-02-11 14:12:21 +00:00
Neil Alexander
9e489845eb Fix #842 - again... 2020-01-09 17:18:19 +00:00
Neil Alexander
ee8e167844 Fix #842 2020-01-09 17:09:17 +00:00
Neil Alexander
714959126b
Fall back to postgres when database connection string parsing fails (#842)
* Fall back to postgres when parsing the database connection string for a URI schema fails

* Fix behaviour so that it really tries postgres when URL parsing fails and it complains about unknown schema if it succeeds
2020-01-09 17:03:36 +00:00
Neil Alexander
c28577ea25
Implement storage interfaces (#841)
* Implement interfaces for federationsender storage

* Implement interfaces for mediaapi storage

* Implement interfaces for publicroomsapi storage

* Implement interfaces for roomserver storage

* Implement interfaces for syncapi storage

* Implement interfaces for keydb storage

* common.PartitionStorer in publicroomsapi interface

* Update copyright notices
2020-01-03 14:07:05 +00:00
Neil Alexander
b4d638cd04
Return server names (#833)
* Remove unnecessary map->array processing

* Return server names in room federation directory query

* Knock off a TODO
2019-12-20 13:24:57 +00:00
Alex Chen
5e25f6ba22
Set up queryAPI in federationsender (#791) 2019-08-24 01:25:10 +08:00
Alex Chen
5eb63f1d1e
Add joined hosts query APIs (#781)
This adds two joined hosts query APIs to the federation sender for use of other components.
2019-08-22 19:47:52 +08:00
Alex Chen
f8d2860765 Replace membership and visibility values with constants (#774)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-08-06 15:07:36 +01:00
Andrew Morgan
1eb77b8161
Don't print Sending EDU if there is noone to send to (#721)
The logs had a lot of:

```
Sending EDU event                             destinations="[]" edu_type=m.typing
```

Which is useless if it isn't actually sending the event anywhere (destinations is empty).
2019-07-01 16:04:49 +01:00
ruben
74827428bd use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00