Update Plugin.GenServer to match the same pattern that Plugin.Supervisor does, remove Omnibot.Plugin

* using Plugin.GenServer now uses Plugin.Base so that is not required
* Remove Omnibot.Plugin because all it did was include Plugin.GenServer
  and Plugin.Base

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-07-11 16:01:57 -07:00
parent 9a8c6f2472
commit e2a746709d
7 changed files with 7 additions and 15 deletions

View File

@@ -6,9 +6,9 @@ defmodule Omnibot.Contrib.Markov do
@default_config path: "markov", order: 2, save_every: 5 * 60
@impl true
def children(_cfg, _state) do
def children(cfg, _state) do
[{Task, fn ->
Stream.timer(1000)
Stream.timer(cfg[:save_every] * 1000)
|> Stream.cycle()
|> Stream.each(fn _ -> save_chains() end)
|> Stream.run()