Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Sockwell 37b652ad79
Error handling, pt3 (#131)
* Improve handling of Postgres errors

* Finish error handling improvements

* Remove `format!` calls from hot path
2020-04-14 20:37:49 -04:00
Daniel Sockwell 45f9d4b9fb
Code reorganization (#130)
* Reorganize files

* Refactor main()

* Code reorganization [WIP]

* Reorganize code [WIP]

* Refacto RedisConn [WIP]

* Complete code reorganization
2020-04-13 16:03:06 -04:00
Daniel Sockwell 0acbde3eee
Reorganize code, pt1 (#110)
* Prevent Reciever from querying postgres

Before this commit, the Receiver would query Postgres for the name
associated with a hashtag when it encountered one not in its cache.
This ensured that the Receiver never encountered a (valid) hashtag id
that it couldn't handle, but caused a extra DB query and made
independent sections of the code more entangled than they need to be.

Now, we pass the relevant tag name to the Receiver when it first
starts managing a new subscription and it adds the tag name to its
cache then.

* Improve module boundary/privacy

* Reorganize Receiver to cut RedisStream

* Fix tests for code reorganization

Note that this change includes testing some private functionality by
exposing it publicly in tests via conditional compilation.  This
doesn't expose that functionality for the benchmarks, so the benchmark
tests do not currently pass without adding a few `pub use`
statements.  This might be worth changing later, but benchmark tests
aren't part of our CI and it's not hard to change when we want to test
performance.

This change also cuts the benchmark tests that were benchmarking old
ways Flodgatt functioned.  Those were useful for comparison purposes,
but have served their purpose – we've firmly moved away from the
older/slower approach.

* Fix Receiver for tests
2020-03-27 12:00:48 -04:00
Daniel Sockwell a6b4d968cb
Add support for WHITELIST_MODE (#99)
When the `WHITELIST_MODE` environmental variable is set, Flodgatt
requires users to authenticate with a valid access token before
subscribing to any timelines (even those that are typically public).
2020-03-20 14:42:01 -04:00
Daniel Sockwell 597d024b8f Add api/v1/streaming/health API endpoint (#74) 2020-01-08 09:30:42 -05:00
Daniel Sockwell 0de3d3c484
Postgres config (#70)
* Add logging for known env variables

* Update postgres config to match other configs

* Update README and bump version to 0.4.2
2020-01-05 21:58:18 -05:00
Daniel Sockwell c281418f25
Enforce type safety in config (#63)
* Add type-safe wrapper types to deployement_cfg

* Before deleting redundnat macros

* Store error messages as data

* Significant progress on type safety

* Add type safety to RedisConfig
2019-10-08 20:35:26 -04:00