Mercurial Hosting > chat
comparison src/lib/Db.luan @ 55:d21ae4920aac
minor fix
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 03 Mar 2025 21:42:38 -0700 |
| parents | 9298b04607ae |
| children | c420f39eb474 |
comparison
equal
deleted
inserted
replaced
| 54:1d724f187cff | 55:d21ae4920aac |
|---|---|
| 27 | 27 |
| 28 Db.indexed_fields.post_chat_id = Lucene.type.long | 28 Db.indexed_fields.post_chat_id = Lucene.type.long |
| 29 Db.indexed_fields.post_date = Lucene.type.long | 29 Db.indexed_fields.post_date = Lucene.type.long |
| 30 | 30 |
| 31 Db.indexed_fields.chatuser_id = Lucene.type.string | 31 Db.indexed_fields.chatuser_id = Lucene.type.string |
| 32 Db.indexed_fields.chatuser_chat_id = Lucene.type.long | |
| 32 | 33 |
| 33 function Db.not_in_transaction() | 34 function Db.not_in_transaction() |
| 34 logger.error(new_error("not in transaction")) | 35 logger.error(new_error("not in transaction")) |
| 35 end | 36 end |
| 36 | 37 |
| 40 for _, doc in ipairs(docs) do | 41 for _, doc in ipairs(docs) do |
| 41 doc.post_date = doc.post_date or doc.date | 42 doc.post_date = doc.post_date or doc.date |
| 42 Db.save(doc) | 43 Db.save(doc) |
| 43 end | 44 end |
| 44 end | 45 end |
| 46 [2] = function() | |
| 47 Db.delete("type:chatuser") | |
| 48 end | |
| 45 } | 49 } |
| 46 | 50 |
| 47 if Http.is_serving then | 51 if Http.is_serving then |
| 48 Thread.schedule( Db.check, { delay=0, repeating_delay=Time.period{hours=1} } ) | 52 Thread.schedule( Db.check, { delay=0, repeating_delay=Time.period{hours=1} } ) |
| 49 end | 53 end |
