Software / code / prosody
Comparison
plugins/mod_storage_sql.lua @ 9891:147b28d001a0
mod_storage_sql: Skip cache write
This would cause the cache to be wrong in case the the later INSERT
fails and the transaction is aborted.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 22 Mar 2019 02:12:02 +0100 |
| parent | 9890:b5ac12f97f34 |
| child | 9892:4803a25c7e36 |
comparison
equal
deleted
inserted
replaced
| 9890:b5ac12f97f34 | 9891:147b28d001a0 |
|---|---|
| 280 ]]; | 280 ]]; |
| 281 if key then | 281 if key then |
| 282 local result, err = engine:delete(delete_sql, host, user or "", store, key); | 282 local result, err = engine:delete(delete_sql, host, user or "", store, key); |
| 283 if result then | 283 if result then |
| 284 item_count = item_count - result:affected(); | 284 item_count = item_count - result:affected(); |
| 285 archive_item_count_cache:set(cache_key, item_count); | |
| 286 end | 285 end |
| 287 else | 286 else |
| 288 key = uuid.generate(); | 287 key = uuid.generate(); |
| 289 end | 288 end |
| 290 local t, encoded_value = assert(serialize(value)); | 289 local t, encoded_value = assert(serialize(value)); |