mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-24 17:49:07 -05:00
refactor: reformat and remove tabs
This commit is contained in:
parent
6800c2e39d
commit
6489e685ab
|
@ -57,7 +57,8 @@ fn is_all_fs(s: &str) -> bool {
|
||||||
} else if odd {
|
} else if odd {
|
||||||
// check if first char in this byte is NOT 'f'
|
// check if first char in this byte is NOT 'f'
|
||||||
if b < 240 {
|
if b < 240 {
|
||||||
upper[byte_len] = b + 16; // bump up the first character in this byte
|
// bump up the first character in this byte
|
||||||
|
upper[byte_len] = b + 16;
|
||||||
// increment done, stop iterating through the vec
|
// increment done, stop iterating through the vec
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,8 @@ use std::sync::mpsc as syncmpsc;
|
||||||
use std::sync::mpsc::{Receiver as MpscReceiver, Sender as MpscSender};
|
use std::sync::mpsc::{Receiver as MpscReceiver, Sender as MpscSender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
|
|
||||||
use console_subscriber::ConsoleLayer;
|
use console_subscriber::ConsoleLayer;
|
||||||
|
|
||||||
|
|
||||||
/// Start running a Nostr relay server.
|
/// Start running a Nostr relay server.
|
||||||
fn main() {
|
fn main() {
|
||||||
// configure settings from config.toml
|
// configure settings from config.toml
|
||||||
|
|
|
@ -327,7 +327,6 @@ pub fn start_server(settings: &Settings, shutdown_rx: MpscReceiver<()>) -> Resul
|
||||||
let controlled_shutdown = invoke_shutdown.clone();
|
let controlled_shutdown = invoke_shutdown.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
info!("control message listener started");
|
info!("control message listener started");
|
||||||
// we only have good "shutdown" messages propagation from this-> controlled shutdown. Not from controlled_shutdown-> this. Which means we have a task that is stuck waiting on a sync receive. recv is blocking, and this is async.
|
|
||||||
match shutdown_rx.recv() {
|
match shutdown_rx.recv() {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
info!("control message requesting shutdown");
|
info!("control message requesting shutdown");
|
||||||
|
@ -552,7 +551,6 @@ async fn nostr_server(
|
||||||
if !sub.interested_in_event(&global_event) {
|
if !sub.interested_in_event(&global_event) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: serialize at broadcast time, instead of
|
// TODO: serialize at broadcast time, instead of
|
||||||
// once for each consumer.
|
// once for each consumer.
|
||||||
if let Ok(event_str) = serde_json::to_string(&global_event) {
|
if let Ok(event_str) = serde_json::to_string(&global_event) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user