mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
logging
This commit is contained in:
1 parent
bbd758391b
commit
fc05752ce1
1 file changed
+6
@@ -42,6 +42,8 @@ const ENV_REDIS_MAX_RETRY_COUNT_DEFAULT : u32 = 3;
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
easyenv::init_env_logger(None);
|
||||
|
||||
info!("Reading env configs...");
|
||||
|
||||
let redis_publish_topic = easyenv::get_env_string_or_default(
|
||||
ENV_PUBLISH_TOPIC, ENV_PUBLISH_TOPIC_DEFAULT);
|
||||
|
||||
@@ -56,6 +58,8 @@ async fn main() -> anyhow::Result<()> {
|
||||
redis_max_retry_count
|
||||
);
|
||||
|
||||
info!("Connecting Redis client...");
|
||||
|
||||
redis_client.connect().await?;
|
||||
|
||||
let mut twitch_client = TwitchClient::new(
|
||||
@@ -64,6 +68,8 @@ async fn main() -> anyhow::Result<()> {
|
||||
&redis_publish_topic
|
||||
);
|
||||
|
||||
info!("Beginning Twitch main loop...");
|
||||
|
||||
loop {
|
||||
twitch_client.main_loop().await; // NB: Doesn't return.
|
||||
thread::sleep(Duration::from_secs(5));
|
||||
|
||||
Reference in new issue
Block a user