fix
This commit is contained in:
parent
b1cba1cba2
commit
17fda6a0b7
|
|
@ -31,7 +31,7 @@ func InitWeatherCache(ctx context.Context, data *config.Redis) error {
|
||||||
// 设置某个地方的天气情况
|
// 设置某个地方的天气情况
|
||||||
func SetWeatherCondition(ctx context.Context, key, condition string) error {
|
func SetWeatherCondition(ctx context.Context, key, condition string) error {
|
||||||
redis_key := fmt.Sprintf("%s-condition", key)
|
redis_key := fmt.Sprintf("%s-condition", key)
|
||||||
_, err := _redis.SetNX(ctx, redis_key, condition, _expire).Result()
|
_, err := _redis.Set(ctx, redis_key, condition, _expire).Result()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ func GetWeatherCondition(ctx context.Context, key string) (string, error) {
|
||||||
// 设置某个地方的天气预报
|
// 设置某个地方的天气预报
|
||||||
func SetDailyForecasts(ctx context.Context, key, forecasts string) error {
|
func SetDailyForecasts(ctx context.Context, key, forecasts string) error {
|
||||||
redis_key := fmt.Sprintf("%s-forecasts", key)
|
redis_key := fmt.Sprintf("%s-forecasts", key)
|
||||||
_, err := _redis.SetNX(ctx, redis_key, forecasts, _expire).Result()
|
_, err := _redis.Set(ctx, redis_key, forecasts, _expire).Result()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue