Skip to content

Commit

Permalink
fix(sled-provider): slug generation (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzeuzs authored Feb 23, 2023
1 parent a2136a9 commit 1cf9cbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/sled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;

use anyhow::Result;
use async_trait::async_trait;
use cuid::cuid;
use cuid2::create_id;
use redis::{AsyncCommands, Client};
use sled::Db;

Expand Down Expand Up @@ -49,7 +49,7 @@ impl Provider for SledProvider {

async fn set(&self, slug: String, data: Vec<u8>) -> Result<()> {
let mut con = self.redis.get_async_connection().await?;
let key = cuid()?;
let key = create_id();

con.set(format!("{}:{slug}", SledProvider::prefix()), &key).await?;
self.db.insert(key, data)?;
Expand Down

0 comments on commit 1cf9cbf

Please sign in to comment.