mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b225498c42 | |||
| f7bd9eaba8 | |||
| f9c42bbadc | |||
| fe62c39501 | |||
| 35320cf0d4 | |||
| eaf6a889c2 | |||
| b04f1332db | |||
| 9e4bcda17b |
@@ -46,6 +46,9 @@ creds:
|
|||||||
- registry: ghcr.io
|
- registry: ghcr.io
|
||||||
user: "{{env \"GH_PACKAGES_USER\"}}"
|
user: "{{env \"GH_PACKAGES_USER\"}}"
|
||||||
pass: "{{env \"GH_PACKAGES_TOKEN\"}}"
|
pass: "{{env \"GH_PACKAGES_TOKEN\"}}"
|
||||||
|
- registry: docker.io
|
||||||
|
user: "{{env \"DOCKER_MIRROR_USER\"}}"
|
||||||
|
pass: "{{env \"DOCKER_MIRROR_TOKEN\"}}"
|
||||||
|
|
||||||
# Global defaults
|
# Global defaults
|
||||||
defaults:
|
defaults:
|
||||||
@@ -67,3 +70,7 @@ sync:
|
|||||||
target: ghcr.io/continuwuity/continuwuity
|
target: ghcr.io/continuwuity/continuwuity
|
||||||
type: repository
|
type: repository
|
||||||
<<: *tags-main
|
<<: *tags-main
|
||||||
|
- source: *source
|
||||||
|
target: docker.io/jadedblueeyes/continuwuity
|
||||||
|
type: repository
|
||||||
|
<<: *tags-main
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ jobs:
|
|||||||
N7574_GIT_TOKEN: ${{ secrets.N7574_GIT_TOKEN }}
|
N7574_GIT_TOKEN: ${{ secrets.N7574_GIT_TOKEN }}
|
||||||
GH_PACKAGES_USER: ${{ vars.GH_PACKAGES_USER }}
|
GH_PACKAGES_USER: ${{ vars.GH_PACKAGES_USER }}
|
||||||
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
|
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
|
||||||
|
DOCKER_MIRROR_USER: ${{ vars.DOCKER_MIRROR_USER }}
|
||||||
|
DOCKER_MIRROR_TOKEN: ${{ secrets.DOCKER_MIRROR_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|||||||
+1
-1
@@ -947,7 +947,7 @@ semicolon_outside_block = "warn"
|
|||||||
str_to_string = "warn"
|
str_to_string = "warn"
|
||||||
string_lit_chars_any = "warn"
|
string_lit_chars_any = "warn"
|
||||||
string_slice = "warn"
|
string_slice = "warn"
|
||||||
string_to_string = "warn"
|
|
||||||
suspicious_xor_used_as_pow = "warn"
|
suspicious_xor_used_as_pow = "warn"
|
||||||
tests_outside_test_module = "warn"
|
tests_outside_test_module = "warn"
|
||||||
try_err = "warn"
|
try_err = "warn"
|
||||||
|
|||||||
@@ -421,8 +421,8 @@ where
|
|||||||
/// `key_fn` is used as to obtain the power level and age of an event for
|
/// `key_fn` is used as to obtain the power level and age of an event for
|
||||||
/// breaking ties (together with the event ID).
|
/// breaking ties (together with the event ID).
|
||||||
#[tracing::instrument(level = "debug", skip_all)]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
pub async fn lexicographical_topological_sort<Id, F, Fut, Hasher>(
|
pub async fn lexicographical_topological_sort<Id, F, Fut, Hasher, S>(
|
||||||
graph: &HashMap<Id, HashSet<Id, Hasher>>,
|
graph: &HashMap<Id, HashSet<Id, Hasher>, S>,
|
||||||
key_fn: &F,
|
key_fn: &F,
|
||||||
) -> Result<Vec<Id>>
|
) -> Result<Vec<Id>>
|
||||||
where
|
where
|
||||||
@@ -430,6 +430,7 @@ where
|
|||||||
Fut: Future<Output = Result<(Int, MilliSecondsSinceUnixEpoch)>> + Send,
|
Fut: Future<Output = Result<(Int, MilliSecondsSinceUnixEpoch)>> + Send,
|
||||||
Id: Borrow<EventId> + Clone + Eq + Hash + Ord + Send + Sync,
|
Id: Borrow<EventId> + Clone + Eq + Hash + Ord + Send + Sync,
|
||||||
Hasher: BuildHasher + Default + Clone + Send + Sync,
|
Hasher: BuildHasher + Default + Clone + Send + Sync,
|
||||||
|
S: BuildHasher + Clone + Send + Sync,
|
||||||
{
|
{
|
||||||
#[derive(PartialEq, Eq)]
|
#[derive(PartialEq, Eq)]
|
||||||
struct TieBreaker<'a, Id> {
|
struct TieBreaker<'a, Id> {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use conduwuit::{
|
|||||||
use futures::{Stream, StreamExt, TryStreamExt};
|
use futures::{Stream, StreamExt, TryStreamExt};
|
||||||
use rocksdb::{DBPinnableSlice, ReadOptions};
|
use rocksdb::{DBPinnableSlice, ReadOptions};
|
||||||
|
|
||||||
use super::get::{cached_handle_from, handle_from};
|
use super::get::handle_from;
|
||||||
use crate::Handle;
|
use crate::Handle;
|
||||||
|
|
||||||
pub trait Get<'a, K, S>
|
pub trait Get<'a, K, S>
|
||||||
@@ -58,20 +58,6 @@ where
|
|||||||
.try_flatten()
|
.try_flatten()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[implement(super::Map)]
|
|
||||||
#[tracing::instrument(name = "batch_cached", level = "trace", skip_all)]
|
|
||||||
pub(crate) fn get_batch_cached<'a, I, K>(
|
|
||||||
&self,
|
|
||||||
keys: I,
|
|
||||||
) -> impl Iterator<Item = Result<Option<Handle<'_>>>> + Send + use<'_, I, K>
|
|
||||||
where
|
|
||||||
I: Iterator<Item = &'a K> + ExactSizeIterator + Send,
|
|
||||||
K: AsRef<[u8]> + Send + ?Sized + Sync + 'a,
|
|
||||||
{
|
|
||||||
self.get_batch_blocking_opts(keys, &self.cache_read_options)
|
|
||||||
.map(cached_handle_from)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[implement(super::Map)]
|
#[implement(super::Map)]
|
||||||
#[tracing::instrument(name = "batch_blocking", level = "trace", skip_all)]
|
#[tracing::instrument(name = "batch_blocking", level = "trace", skip_all)]
|
||||||
pub(crate) fn get_batch_blocking<'a, I, K>(
|
pub(crate) fn get_batch_blocking<'a, I, K>(
|
||||||
|
|||||||
+11
-11
@@ -184,7 +184,7 @@ fn spawn_one(
|
|||||||
let handle = thread::Builder::new()
|
let handle = thread::Builder::new()
|
||||||
.name(WORKER_NAME.into())
|
.name(WORKER_NAME.into())
|
||||||
.stack_size(WORKER_STACK_SIZE)
|
.stack_size(WORKER_STACK_SIZE)
|
||||||
.spawn(move || self.worker(id, recv))?;
|
.spawn(move || self.worker(id, &recv))?;
|
||||||
|
|
||||||
workers.push(handle);
|
workers.push(handle);
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ async fn execute(&self, queue: &Sender<Cmd>, cmd: Cmd) -> Result {
|
|||||||
tid = ?thread::current().id(),
|
tid = ?thread::current().id(),
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
fn worker(self: Arc<Self>, id: usize, recv: Receiver<Cmd>) {
|
fn worker(self: Arc<Self>, id: usize, recv: &Receiver<Cmd>) {
|
||||||
self.worker_init(id);
|
self.worker_init(id);
|
||||||
self.worker_loop(&recv);
|
self.worker_loop(recv);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[implement(Pool)]
|
#[implement(Pool)]
|
||||||
@@ -309,7 +309,7 @@ fn worker_loop(self: &Arc<Self>, recv: &Receiver<Cmd>) {
|
|||||||
self.busy.fetch_add(1, Ordering::Relaxed);
|
self.busy.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
||||||
while let Ok(cmd) = self.worker_wait(recv) {
|
while let Ok(cmd) = self.worker_wait(recv) {
|
||||||
self.worker_handle(cmd);
|
Pool::worker_handle(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,11 +331,11 @@ fn worker_wait(self: &Arc<Self>, recv: &Receiver<Cmd>) -> Result<Cmd, RecvError>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[implement(Pool)]
|
#[implement(Pool)]
|
||||||
fn worker_handle(self: &Arc<Self>, cmd: Cmd) {
|
fn worker_handle(cmd: Cmd) {
|
||||||
match cmd {
|
match cmd {
|
||||||
| Cmd::Get(cmd) if cmd.key.len() == 1 => self.handle_get(cmd),
|
| Cmd::Get(cmd) if cmd.key.len() == 1 => Pool::handle_get(cmd),
|
||||||
| Cmd::Get(cmd) => self.handle_batch(cmd),
|
| Cmd::Get(cmd) => Pool::handle_batch(cmd),
|
||||||
| Cmd::Iter(cmd) => self.handle_iter(cmd),
|
| Cmd::Iter(cmd) => Pool::handle_iter(cmd),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ fn worker_handle(self: &Arc<Self>, cmd: Cmd) {
|
|||||||
skip_all,
|
skip_all,
|
||||||
fields(%cmd.map),
|
fields(%cmd.map),
|
||||||
)]
|
)]
|
||||||
fn handle_iter(&self, mut cmd: Seek) {
|
fn handle_iter(mut cmd: Seek) {
|
||||||
let chan = cmd.res.take().expect("missing result channel");
|
let chan = cmd.res.take().expect("missing result channel");
|
||||||
|
|
||||||
if chan.is_canceled() {
|
if chan.is_canceled() {
|
||||||
@@ -375,7 +375,7 @@ fn handle_iter(&self, mut cmd: Seek) {
|
|||||||
keys = %cmd.key.len(),
|
keys = %cmd.key.len(),
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
fn handle_batch(self: &Arc<Self>, mut cmd: Get) {
|
fn handle_batch(mut cmd: Get) {
|
||||||
debug_assert!(cmd.key.len() > 1, "should have more than one key");
|
debug_assert!(cmd.key.len() > 1, "should have more than one key");
|
||||||
debug_assert!(!cmd.key.iter().any(SmallVec::is_empty), "querying for empty key");
|
debug_assert!(!cmd.key.iter().any(SmallVec::is_empty), "querying for empty key");
|
||||||
|
|
||||||
@@ -401,7 +401,7 @@ fn handle_batch(self: &Arc<Self>, mut cmd: Get) {
|
|||||||
skip_all,
|
skip_all,
|
||||||
fields(%cmd.map),
|
fields(%cmd.map),
|
||||||
)]
|
)]
|
||||||
fn handle_get(&self, mut cmd: Get) {
|
fn handle_get(mut cmd: Get) {
|
||||||
debug_assert!(!cmd.key[0].is_empty(), "querying for empty key");
|
debug_assert!(!cmd.key[0].is_empty(), "querying for empty key");
|
||||||
|
|
||||||
// Obtain the result channel.
|
// Obtain the result channel.
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ pub(super) fn refutable(mut item: ItemFn, _args: &[Meta]) -> Result<TokenStream>
|
|||||||
};
|
};
|
||||||
|
|
||||||
let name = format!("_args_{i}");
|
let name = format!("_args_{i}");
|
||||||
*pat = Box::new(Pat::Ident(PatIdent {
|
**pat = Pat::Ident(PatIdent {
|
||||||
ident: Ident::new(&name, Span::call_site().into()),
|
ident: Ident::new(&name, Span::call_site().into()),
|
||||||
attrs: Vec::new(),
|
attrs: Vec::new(),
|
||||||
by_ref: None,
|
by_ref: None,
|
||||||
mutability: None,
|
mutability: None,
|
||||||
subpat: None,
|
subpat: None,
|
||||||
}));
|
});
|
||||||
|
|
||||||
let field = fields.iter();
|
let field = fields.iter();
|
||||||
let refute = quote! {
|
let refute = quote! {
|
||||||
|
|||||||
@@ -188,9 +188,7 @@ impl Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self), level = "debug")]
|
#[tracing::instrument(skip(self), level = "debug")]
|
||||||
pub fn all_local_aliases<'a>(
|
pub fn all_local_aliases(&self) -> impl Stream<Item = (&RoomId, &str)> + Send + '_ {
|
||||||
&'a self,
|
|
||||||
) -> impl Stream<Item = (&'a RoomId, &'a str)> + Send + 'a {
|
|
||||||
self.db
|
self.db
|
||||||
.alias_roomid
|
.alias_roomid
|
||||||
.stream()
|
.stream()
|
||||||
|
|||||||
Reference in New Issue
Block a user