nandi/gleanpublic⑂ Fork 0
⑂ d4ef62e
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Fix query + improve perf docker buildUnverified

Julien Robert committed 2026-04-22T13:26:10+02:00 Browse files
d4ef62e parent: 11b97b9
added .dockerignore +4 -0
new file mode 100644
@@ -0,0 +1,4 @@
1+.git
2+.env
3+node_modules
4+glean.db
new file mode 100644
@@ -0,0 +1,4 @@
1+.git
2+.env
3+node_modules
4+glean.db
modified Dockerfile +4 -2
@@ -10,8 +10,10 @@ COPY package.json package-lock.json ./
1010 RUN npm ci
1111
1212 COPY . .
13-RUN npx tailwindcss -i ./static/input.css -o ./static/output.css --minify \
14- && CGO_ENABLED=1 go build -tags fts5 -ldflags="-s -w" -o /glean .
13+RUN npx tailwindcss -i ./static/input.css -o ./static/output.css --minify
14+
15+RUN --mount=type=cache,target=/root/.cache/go-build \
16+ CGO_ENABLED=1 go build -tags fts5 -ldflags="-s -w" -o /glean .
1517
1618 FROM alpine:3.21
1719
@@ -10,8 +10,10 @@ COPY package.json package-lock.json ./
10 RUN npm ci10 RUN npm ci
11 11
12 COPY . .12 COPY . .
13-RUN npx tailwindcss -i ./static/input.css -o ./static/output.css --minify \13+RUN npx tailwindcss -i ./static/input.css -o ./static/output.css --minify
14- && CGO_ENABLED=1 go build -tags fts5 -ldflags="-s -w" -o /glean .14+
15+RUN --mount=type=cache,target=/root/.cache/go-build \
16+ CGO_ENABLED=1 go build -tags fts5 -ldflags="-s -w" -o /glean .
15 17
16 FROM alpine:3.2118 FROM alpine:3.21
17 19
modified internal/cluster/social.go +1 -1
@@ -49,7 +49,7 @@ func (e *Engine) ComputeFollowDistancesIncremental(ctx context.Context) error {
4949
5050 var lastComputed string
5151 err = e.db.QueryRowContext(ctx, `
52- SELECT COALESCE(MAX(updated_at), '1970-01-01') FROM user_similarity
52+ SELECT COALESCE(MAX(computed_at), '1970-01-01') FROM user_similarity
5353 `).Scan(&lastComputed)
5454 if err != nil {
5555 return err
@@ -49,7 +49,7 @@ func (e *Engine) ComputeFollowDistancesIncremental(ctx context.Context) error {
49 49
50 var lastComputed string50 var lastComputed string
51 err = e.db.QueryRowContext(ctx, `51 err = e.db.QueryRowContext(ctx, `
52- SELECT COALESCE(MAX(updated_at), '1970-01-01') FROM user_similarity52+ SELECT COALESCE(MAX(computed_at), '1970-01-01') FROM user_similarity
53 `).Scan(&lastComputed)53 `).Scan(&lastComputed)
54 if err != nil {54 if err != nil {
55 return err55 return err
modified internal/server/server.go +4 -0
@@ -405,6 +405,10 @@ func (s *Server) refreshUserFeeds(ctx context.Context, userDID string) {
405405 return
406406 }
407407
408+ // Fetch each feed once, even if many users subscribe to the same feed.
409+ // Dead feeds (error_count >= 25) are intentionally retried here so a new
410+ // user's subscriptions get a chance to succeed before being gated by the
411+ // scheduler's error_count filter.
408412 seen := make(map[string]bool, len(subs))
409413 for _, sub := range subs {
410414 if seen[sub.FeedURL] {
@@ -405,6 +405,10 @@ func (s *Server) refreshUserFeeds(ctx context.Context, userDID string) {
405 return405 return
406 }406 }
407 407
408+ // Fetch each feed once, even if many users subscribe to the same feed.
409+ // Dead feeds (error_count >= 25) are intentionally retried here so a new
410+ // user's subscriptions get a chance to succeed before being gated by the
411+ // scheduler's error_count filter.
408 seen := make(map[string]bool, len(subs))412 seen := make(map[string]bool, len(subs))
409 for _, sub := range subs {413 for _, sub := range subs {
410 if seen[sub.FeedURL] {414 if seen[sub.FeedURL] {