Commit Graph

13 Commits

Author SHA1 Message Date
Kailash Nadh 942eb7c3d8 Add settings UI and "hot reload" support to the app.
This is a major breaking change that moves away from having the
entire app configuration in external TOML files to settings being
in the database with a UI to update them dynamically.

The app loads all config into memory (app settings, SMTP conf)
on boot. "Hot" replacing them is complex and it's a fair tradeoff
to instead just restart the application as it is practically
instant.

A new `settings` table stores arbitrary string keys with a JSONB
value field which happens to support arbitrary types. After every
settings update, the app gracefully releases all resources
(HTTP server, DB pool, SMTP pool etc.) and restarts itself,
occupying the same PID. If there are any running campaigns, the
auto-restart doesn't happen and the user is prompted to invoke
it manually with a one-click button once all running campaigns
have been paused.
2020-07-21 00:23:57 +05:30
Kailash Nadh c2613d1030 Fix ticker leak in campaign manager message push 2020-07-06 20:29:19 +05:30
Kailash Nadh fd044f4cb6 Minor refactor to campaign manager.
- Remove external invocation of worker goroutines into Run()
- Split Run() into smaller functions.
2020-07-06 20:22:57 +05:30
Kailash Nadh 79dd916d09 Make DB pull batch size in campaign manager configurable 2020-07-05 19:48:39 +05:30
Kailash Nadh 64d44707c2 Add {{ templating }} support to e-mail subjects 2020-07-05 18:39:24 +05:30
Kailash Nadh f498cddc7a Add support for hosted messages and `{{ MessageURL }}` tpl tag. 2020-04-26 15:51:43 +05:30
Kailash Nadh 6bba55f0eb Remove 'campaignDone?' check that incorrectly ignored queued
messages in a finishing campaign.
2020-04-25 15:54:25 +05:30
Kailash Nadh 894ede561a Add support for message throughput rate limiting 2020-04-02 18:22:27 +05:30
Kailash Nadh ca032c89d6 Refactor manager.CampaignMessage's exposed fields 2020-03-08 15:02:20 +05:30
Kailash Nadh d4aea0a436 Add support for pushing non-campaign message with workers.
- Refactor campaign.Message into campaign.Message and
  campaign.CampaignMessage
- Remove ad-hoc goroutines (flawed approach) that were used to push
  admin and optin notifications.
- Provision for largscale pushing of ad-hoc, non-campaign messages
  such as transactional messages (in the future).
2020-03-08 12:27:41 +05:30
Kailash Nadh 5f6a4af6b4 Cleanup unnecessary pointers 2020-03-08 11:07:24 +05:30
Kailash Nadh 40ae9cdb31 Minor formatting fixes 2020-03-08 10:54:10 +05:30
Kailash Nadh 9005bb6dad Move internal packages to 'internal' dir 2020-03-08 00:17:54 +05:30