This gets rid of the gorilla/context dependency, which might have been
causing a memory leak.
We noticed some serious memory leakage on Write.as that seemed to point
to this library. One heap snapshot:
flat flat% sum% cum cum%
259.13MB 30.41% 30.41% 268.13MB 31.46% net/textproto.(*Reader).ReadMIMEHeader
105.71MB 12.40% 42.81% 105.71MB 12.40% github.com/gorilla/context.Set
78.53MB 9.21% 52.03% 125.53MB 14.73% github.com/gorilla/sessions.(*Registry).Get
55.51MB 6.51% 58.54% 82.52MB 9.68% net/http.(*Request).WithContext
38.01MB 4.46% 63.00% 38.01MB 4.46% github.com/gorilla/mux.extractVars
35MB 4.11% 67.11% 53MB 6.22% context.WithCancel
34.50MB 4.05% 71.16% 34.50MB 4.05% context.WithValue
27MB 3.17% 74.32% 27MB 3.17% net/http.cloneURL
26MB 3.05% 77.38% 26MB 3.05% github.com/gorilla/sessions.NewSession
18MB 2.11% 79.49% 18MB 2.11% context.(*cancelCtx).Done
16.50MB 1.94% 81.42% 16.50MB 1.94% syscall.anyToSockaddr
14MB 1.64% 83.07% 47MB 5.52% github.com/gorilla/sessions.(*CookieStore).New
13.50MB 1.58% 84.65% 51.51MB 6.04% github.com/gorilla/mux.(*Route).Match
11.67MB 1.37% 86.02% 13.21MB 1.55% regexp.(*Regexp).replaceAll
9.72MB 1.14% 87.16% 22.94MB 2.69% regexp.(*Regexp).ReplaceAllString
9.50MB 1.11% 88.28% 115.21MB 13.52% github.com/gorilla/sessions.GetRegistry
With the help of these articles, we tracked it down to this dependency,
and upgraded the library, which seems to have completely fixed the issue
so far:
https://rover.rocks/golang-memory-leak/https://medium.com/@walterwu_22843/golang-memory-leak-while-handling-huge-amount-of-http-request-35cc970cb75e
This should fix #133
includes cache of latest version and page to view if updates are
available with a link to the latest update's release notes and a link to
check for the latest update now, refreshing the cache manually.
this adds basic support for importing files as blog posts.
.txt and .md are supported at this time and the
collection is selectable, defaulting to draft.
if a collection is specified the post is federated.
GetCollections and GetPublishableCollections now take a hostname
parameter to allow setting the collecion hostname.
All collections used in memory now have their hostname set.
This upgrades the library to v2, which lets you specify that GOMAXPROCs
should always be the max number of CPUs -- and then sets it to that.
One side effect of this is that images are no longer listed in sitemaps.
I'm somehow at a loss on how to build and append the images array we
need, with the library's latest changes.
Fixes #86