Skip to content

Commit

Permalink
Auto merge of #622
Browse files Browse the repository at this point in the history
622: Revert Nightly Downgrade r=HTG-YT a=HTG-YT

Now that the issue in rust-lang/rust#107678 is fixed, the nightly downgrade will hereby be reverted.

Co-authored-by: HTGAzureX1212 <39023054+HTG-YT@users.noreply.github.com>
  • Loading branch information
bors[bot] and HTGAzureX1212 committed Feb 9, 2023
2 parents 768e6b6 + 6368b20 commit 01c281d
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install latest nightly Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly-2023-02-03
toolchain: nightly
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v1
with:
Expand Down
2 changes: 0 additions & 2 deletions discord-frontend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions discord-frontend/hartex-discord-commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@ hartex_localization_core = { path = "../../localization/hartex-localization-core
hartex_localization_macros = { path = "../../localization/hartex-localization-macros" }

hartex_discord_utils = { path = "../../rust-utilities/hartex-discord-utils" }
hartex_kafka_utils = { path = "../../rust-utilities/hartex-kafka-utils" }

rdkafka = { version = "0.29.0", default-features = false, features = ["cmake-build", "external-lz4", "tokio"] }

[features]
34 changes: 0 additions & 34 deletions discord-frontend/hartex-discord-commands/src/general/uptime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,13 @@
* with HarTex. If not, see <https://www.gnu.org/licenses/>.
*/

use std::env;
use std::time::Duration;

use hartex_discord_commands_core::traits::Command;
use hartex_discord_commands_core::CommandMetadata;
use hartex_discord_core::discord::model::application::interaction::Interaction;
use hartex_discord_core::discord::model::http::interaction::InteractionResponse;
use hartex_discord_core::discord::model::http::interaction::InteractionResponseType;
use hartex_discord_core::discord::util::builder::InteractionResponseDataBuilder;
use hartex_discord_utils::CLIENT;
use hartex_eyre::eyre::Report;
use hartex_kafka_utils::traits::ClientConfigUtils;
use hartex_kafka_utils::types::CompressionType;
use rdkafka::producer::FutureProducer;
use rdkafka::producer::FutureRecord;
use rdkafka::util::Timeout;
use rdkafka::ClientConfig;

#[derive(CommandMetadata)]
#[metadata(command_type = 1)]
Expand All @@ -47,30 +37,6 @@ pub struct Uptime;
impl Command for Uptime {
async fn execute(&self, interaction: Interaction) -> hartex_eyre::Result<()> {
let interaction_client = CLIENT.interaction(interaction.application_id);
let bootstrap_servers = env::var("KAFKA_BOOTSTRAP_SERVERS")?
.split(';')
.map(String::from)
.collect::<Vec<_>>();
let producer = ClientConfig::new()
.bootstrap_servers(bootstrap_servers.into_iter())
.compression_type(CompressionType::Lz4)
.delivery_timeout_ms(30000)
.create::<FutureProducer>()?;
let topic = env::var("KAFKA_TOPIC_OUTBOUND_COMMUNICATION")?;

let bytes = b"uptime";

if let Err((error, _)) = producer
.send(
FutureRecord::to(&topic)
.key("OUTBOUND_COMMUNICATION")
.payload(bytes),
Timeout::After(Duration::from_secs(0)),
)
.await
{
return Err(Report::new(error));
}

interaction_client
.create_response(
Expand Down
13 changes: 0 additions & 13 deletions discord-frontend/hartex-discord-leader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@ use hartex_discord_core::tokio::sync::watch;
use hartex_discord_core::tokio::time;
use hartex_kafka_utils::traits::ClientConfigUtils;
use hartex_kafka_utils::types::CompressionType;
use rdkafka::consumer::Consumer;
use rdkafka::consumer::StreamConsumer;
use rdkafka::producer::FutureProducer;
use rdkafka::ClientConfig;

mod inbound;
mod outbound;
mod queue;
mod shards;

Expand All @@ -60,15 +57,6 @@ pub async fn main() -> hartex_eyre::Result<()> {
.split(';')
.map(String::from)
.collect::<Vec<_>>();
let topic = env::var("KAFKA_TOPIC_OUTBOUND_COMMUNICATION")?;

let consumer = ClientConfig::new()
.bootstrap_servers(bootstrap_servers.clone().into_iter())
.compression_type(CompressionType::Lz4)
.group_id("com.github.teamhartex.hartex.outbound.communication.consumer")
.create::<StreamConsumer>()?;

consumer.subscribe(&[&topic])?;

let producer = ClientConfig::new()
.bootstrap_servers(bootstrap_servers.into_iter())
Expand All @@ -89,7 +77,6 @@ pub async fn main() -> hartex_eyre::Result<()> {
tokio::spawn(async move {
tokio::select! {
_ = inbound::handle(shards.iter_mut(), producer) => {},
_ = outbound::consume(consumer) => {},
_ = rx.changed() => {
future::join_all(shards.iter_mut().map(|shard: &mut Shard| async move {
shard.close(CloseFrame::RESUME).await
Expand Down
41 changes: 0 additions & 41 deletions discord-frontend/hartex-discord-leader/src/outbound.rs

This file was deleted.

0 comments on commit 01c281d

Please sign in to comment.