Move init of channels closer to init
This commit is contained in:
parent
08257bab25
commit
c51bfc4603
|
@ -154,15 +154,17 @@ func createMemoryBackend() microsub.Microsub {
|
||||||
backend := memoryBackend{}
|
backend := memoryBackend{}
|
||||||
backend.lock.Lock()
|
backend.lock.Lock()
|
||||||
|
|
||||||
backend.Channels = make(map[string]microsub.Channel)
|
|
||||||
backend.Feeds = make(map[string][]microsub.Feed)
|
backend.Feeds = make(map[string][]microsub.Feed)
|
||||||
channels := []microsub.Channel{
|
channels := []microsub.Channel{
|
||||||
{UID: "notifications", Name: "Notifications"},
|
{UID: "notifications", Name: "Notifications"},
|
||||||
{UID: "home", Name: "Home"},
|
{UID: "home", Name: "Home"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backend.Channels = make(map[string]microsub.Channel)
|
||||||
for _, c := range channels {
|
for _, c := range channels {
|
||||||
backend.Channels[c.UID] = c
|
backend.Channels[c.UID] = c
|
||||||
}
|
}
|
||||||
|
|
||||||
backend.NextUid = 1000000
|
backend.NextUid = 1000000
|
||||||
backend.Me = "https://example.com/"
|
backend.Me = "https://example.com/"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user