sourcegraph/internal/rcache/BUILD.bazel
Julie Tibshirani e65e736cb1
Redis: simplify DeleteAllKeysWithPrefix (#64407)
The `DeleteAllKeysWithPrefix` method is now only used in tests to ensure
the test keyspace is clear. This PR makes it clear this method is only
used in tests, and simplifies the implementation so it no longer needs a
script + direct Redis connection.

Another tiny Redis refactor to prepare for multi-tenancy work.
2024-08-12 15:25:33 +03:00

37 lines
847 B
Python

load("//dev:go_defs.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "rcache",
srcs = [
"fifo_list.go",
"rcache.go",
],
importpath = "github.com/sourcegraph/sourcegraph/internal/rcache",
visibility = ["//:__subpackages__"],
deps = [
"//internal/redispool",
"//lib/errors",
"@com_github_gomodule_redigo//redis",
"@com_github_inconshreveable_log15//:log15",
],
)
go_test(
name = "rcache_test",
timeout = "short",
srcs = [
"fifo_list_test.go",
"rcache_test.go",
],
embed = [":rcache"],
tags = [
# Test requires localhost database
"requires-network",
],
deps = [
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
],
)