fix
This commit is contained in:
@@ -28,13 +28,20 @@ class Redis {
|
|||||||
Future<String?> get(String key) async {
|
Future<String?> get(String key) async {
|
||||||
return await _command?.send_object(["GET", key]);
|
return await _command?.send_object(["GET", key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> setWithExpiry(String key, String value, int ttlInSeconds) async {
|
||||||
|
var response = await _command
|
||||||
|
?.send_object(["SETEX", key, ttlInSeconds.toString(), value]);
|
||||||
|
return response == "OK";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RedisConfig {
|
class RedisConfig {
|
||||||
String host;
|
String host;
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
RedisConfig(
|
RedisConfig({
|
||||||
{required this.host,
|
required this.host,
|
||||||
this.port = 6379,});
|
this.port = 6379,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user