UBERF-6161: Storage configuration (#5109)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-04-02 14:05:16 +07:00
committed by GitHub
parent 5da63b70f4
commit 0803bb4ea2
50 changed files with 1254 additions and 713 deletions
+3 -2
View File
@@ -14,7 +14,7 @@
// limitations under the License.
//
import { DOMAIN_TX, type Ref, type WorkspaceId } from '@hcengineering/core'
import { DOMAIN_TX, type MeasureContext, type Ref, type WorkspaceId } from '@hcengineering/core'
import { type StorageAdapter } from '@hcengineering/server-core'
import { DOMAIN_ATTACHMENT } from '@hcengineering/model-attachment'
import contact, { DOMAIN_CHANNEL } from '@hcengineering/model-contact'
@@ -29,6 +29,7 @@ const LastMessages = 'last-msgs'
* @public
*/
export async function clearTelegramHistory (
ctx: MeasureContext,
mongoUrl: string,
workspaceId: WorkspaceId,
tgDb: string,
@@ -90,7 +91,7 @@ export async function clearTelegramHistory (
workspaceDB.collection(DOMAIN_ATTACHMENT).deleteMany({
attachedToClass: telegram.class.Message
}),
storageAdapter.remove(workspaceId, Array.from(attachments))
storageAdapter.remove(ctx, workspaceId, Array.from(attachments))
])
console.log('clearing telegram service data...')