-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WJ-1145] Add initial redis support #1668
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c4dd8e7
Rename directory to minio, service name.
emmiegit a201585
Add redis container to Docker configuration.
emmiegit 4251343
Fix sysctl.conf
emmiegit 679b61e
Prefer IPv4 for hosting.
emmiegit b4588d7
Remove sysctl.conf from redis image.
emmiegit 65b1393
Add redis crate.
emmiegit faa9684
Add rmsq_async crate.
emmiegit f147b51
Add redis_url to Secrets structure.
emmiegit 54c802f
Add features to redis dependency.
emmiegit a82bf1d
Add redis::connect() for state setup.
emmiegit 2622e59
Add redis items to ServerStateInner, add Debug impl.
emmiegit 5cd645f
Bind to any, not localhost.
emmiegit 82dcecd
Add REDIS_URL to env.
emmiegit 44601de
Move redis.conf to local/dev specifically.
emmiegit 5675e8e
Disable redis protected mode for local.
emmiegit 7f2252a
Add accessor methods for new redis fields.
emmiegit 0f25c09
Fix ownership problem by using MultiplexedRsmq.
emmiegit 5817b48
Fix redis image build.
emmiegit 6e806cd
Add Error::Redis case.
emmiegit ddf4e22
Enable keep-alive feature in redis.
emmiegit d3f9f22
Add health check in redis to ping.
emmiegit 3177524
Run database checks in parallel.
emmiegit c3d96b8
Add logging for debug kinds.
emmiegit 561d477
Suppress unused warning and link Jira.
emmiegit d68df5c
Add local redis workflow.
emmiegit 3cbf41c
Add missing minio GitHub workflow too.
emmiegit ec5ac7f
Change directory to Dockerfile location first.
emmiegit c20266d
Specify paths for docker build.
emmiegit cf9a0bf
Address clippy lint.
emmiegit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: '[backend] Docker build Minio (local)' | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'install/local/dev/minio/*' | ||
- '.github/workflows/docker-build-minio.local.yaml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: cd install/local/dev/minio && docker build . | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: '[backend] Docker build Redis (local)' | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'install/local/dev/redis/*' | ||
- '.github/workflows/docker-build-redis.local.yaml' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: cd install/local/dev/redis && docker build . | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* cache.rs | ||
* | ||
* DEEPWELL - Wikijump API provider and database manager | ||
* Copyright (C) 2019-2023 Wikijump Team | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
use crate::services::Result; | ||
use rsmq_async::Rsmq; | ||
|
||
/// Creates primary `redis::Client` instance. | ||
/// | ||
/// Used to spawn off other connections to Redis as needed. | ||
pub async fn connect_redis(redis_uri: &str) -> Result<redis::Client> { | ||
let client = redis::Client::open(redis_uri)?; | ||
Ok(client) | ||
} | ||
|
||
/// Creates an RSMQ instance for temporary use. | ||
/// | ||
/// A connection is fetched from the `Client`, which is then used to create | ||
/// an owned `Rsmq` available for use by the caller. | ||
pub async fn connect_rsmq(client: &redis::Client) -> Result<Rsmq> { | ||
let connection = client.get_tokio_connection().await?; | ||
Ok(Rsmq::new_with_connection(connection, true, None)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis::ai::ConnectionManager
is notDebug