Compare commits
No commits in common. "08ea09a347ed94ea1ba86bb7b5202e2f21319945" and "9fa252a6aff033e33a841d9069416d3892b6918c" have entirely different histories.
08ea09a347
...
9fa252a6af
3 changed files with 3 additions and 16 deletions
|
|
@ -1,29 +1,20 @@
|
|||
use redis::AsyncCommands;
|
||||
use sha2::{Digest, Sha256};
|
||||
use tokio::sync::OnceCell;
|
||||
|
||||
/// Redis caching layer implementing the key patterns and TTLs
|
||||
/// defined in DATA_MODEL.md section 3.
|
||||
pub struct CacheService {
|
||||
client: redis::Client,
|
||||
conn: OnceCell<redis::aio::MultiplexedConnection>,
|
||||
}
|
||||
|
||||
impl CacheService {
|
||||
pub fn new(redis_url: &str) -> Result<Self, redis::RedisError> {
|
||||
let client = redis::Client::open(redis_url)?;
|
||||
Ok(Self {
|
||||
client,
|
||||
conn: OnceCell::new(),
|
||||
})
|
||||
Ok(Self { client })
|
||||
}
|
||||
|
||||
async fn conn(&self) -> Result<redis::aio::MultiplexedConnection, redis::RedisError> {
|
||||
let conn = self
|
||||
.conn
|
||||
.get_or_try_init(|| self.client.get_multiplexed_async_connection())
|
||||
.await?;
|
||||
Ok(conn.clone())
|
||||
self.client.get_multiplexed_async_connection().await
|
||||
}
|
||||
|
||||
// ── Tile cache ──────────────────────────────────────────────
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Disable Impeller/Vulkan — vector_map_tiles canvas ops are incompatible with Impeller -->
|
||||
<!-- Disable Impeller/Vulkan — fallback to Skia/OpenGL for devices with poor Vulkan support -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||
android:value="false" />
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ class _MapScreenState extends ConsumerState<MapScreen> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
_mapController = MapController();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
ref.read(mapProvider.notifier).locateUser();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -53,7 +50,6 @@ class _MapScreenState extends ConsumerState<MapScreen> {
|
|||
FlutterMap(
|
||||
mapController: _mapController,
|
||||
options: MapOptions(
|
||||
backgroundColor: Colors.transparent,
|
||||
initialCenter: mapState.center,
|
||||
initialZoom: mapState.zoom,
|
||||
minZoom: 0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue