mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Remove pubsub entries when shutting down and initialize by uri
This commit is contained in:
@ -52,7 +52,7 @@ object RPubSub {
|
||||
url: LenientUri,
|
||||
topics: NonEmptyList[String]
|
||||
): ConnectionIO[Int] =
|
||||
DML.delete(T, T.nodeId === nodeId) *>
|
||||
DML.delete(T, T.nodeId === nodeId || T.url === url) *>
|
||||
topics.toList
|
||||
.traverse(t =>
|
||||
Ident
|
||||
@ -61,6 +61,9 @@ object RPubSub {
|
||||
)
|
||||
.map(_.sum)
|
||||
|
||||
def deleteTopics(nodeId: Ident): ConnectionIO[Int] =
|
||||
DML.delete(T, T.nodeId === nodeId)
|
||||
|
||||
def increment(url: LenientUri, topics: NonEmptyList[String]): ConnectionIO[Int] =
|
||||
DML.update(
|
||||
T,
|
||||
|
Reference in New Issue
Block a user