Compare commits
1
Commits
next
..
e44080fcbb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e44080fcbb |
+4
-8
@@ -33,18 +33,14 @@ RUN golangci-lint run --config .golangci.yml ./...
|
|||||||
# golang:1.24.13-bookworm, 2026-10-06
|
# golang:1.24.13-bookworm, 2026-10-06
|
||||||
FROM golang@sha256:1a6d4452c65dea36aac2e2d606b01b4a029ec90cc1ae53890540ce6173ea77ac AS test
|
FROM golang@sha256:1a6d4452c65dea36aac2e2d606b01b4a029ec90cc1ae53890540ce6173ea77ac AS test
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN mkdir -p web/dist && touch web/dist/index.html web/dist/style.css web/dist/app.js
|
RUN mkdir -p web/dist && touch web/dist/index.html web/dist/style.css web/dist/app.js
|
||||||
# -p 4 because test runs on a shared build host cap their parallelism.
|
# -p 4 because test runs on a shared build host cap their parallelism.
|
||||||
# The modules download in this RUN rather than a layer of their own, because
|
RUN go test -p 4 -timeout 90s -race -cover ./... || \
|
||||||
# exporting a layer that holds them is slow. Nothing reads them or the build
|
|
||||||
# cache afterwards, so go clean removes both.
|
|
||||||
RUN set -e; \
|
|
||||||
go mod download; \
|
|
||||||
go test -p 4 -timeout 90s -race -cover ./... || \
|
|
||||||
{ echo "--- Rerunning with -v for details ---"; \
|
{ echo "--- Rerunning with -v for details ---"; \
|
||||||
go test -p 4 -timeout 90s -race -v ./...; exit 1; }; \
|
go test -p 4 -timeout 90s -race -v ./...; exit 1; }
|
||||||
go clean -cache -modcache
|
|
||||||
|
|
||||||
# Build stage. Nothing is wanted from either phase above; the copies
|
# Build stage. Nothing is wanted from either phase above; the copies
|
||||||
# are what make BuildKit build them first, so this stage cannot run
|
# are what make BuildKit build them first, so this stage cannot run
|
||||||
|
|||||||
@@ -1056,6 +1056,23 @@ func (database *Database) GetChannelMemberIDs(
|
|||||||
return scanInt64s(rows)
|
return scanInt64s(rows)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSessionChannelIDs returns channel IDs for a session.
|
||||||
|
func (database *Database) GetSessionChannelIDs(
|
||||||
|
ctx context.Context,
|
||||||
|
sessionID int64,
|
||||||
|
) ([]int64, error) {
|
||||||
|
rows, err := database.conn.QueryContext(ctx,
|
||||||
|
`SELECT channel_id FROM channel_members
|
||||||
|
WHERE session_id = ?`, sessionID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf(
|
||||||
|
"get session channel ids: %w", err,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return scanInt64s(rows)
|
||||||
|
}
|
||||||
|
|
||||||
// InsertMessage stores a message and returns its DB ID.
|
// InsertMessage stores a message and returns its DB ID.
|
||||||
// toSessionID is the session a DM or INVITE is sent to and
|
// toSessionID is the session a DM or INVITE is sent to and
|
||||||
// toChannelID the channel a channel message is sent to;
|
// toChannelID the channel a channel message is sent to;
|
||||||
|
|||||||
Reference in New Issue
Block a user