Refactor exception usage

This commit is contained in:
Jonas Lochmann 2020-09-28 02:00:00 +02:00
parent d68b425e0e
commit 8d65c5d777
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
148 changed files with 2061 additions and 769 deletions

View file

@ -1,6 +1,6 @@
/*
* server component for the TimeLimit App
* Copyright (C) 2019 Jonas Lochmann
* Copyright (C) 2019 - 2020 Jonas Lochmann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@ -29,9 +29,7 @@ export async function dispatchUpdateAppActivities ({ deviceId, action, cache }:
if (action.updatedOrAdded.length > 0) {
const chuncks = chunk(action.updatedOrAdded, 500)
for (let i = 0; i < chuncks.length; i++) {
const items = chuncks[i]
for (const items of chuncks) {
await cache.database.appActivity.destroy({
where: {
familyId: cache.familyId,
@ -62,9 +60,7 @@ export async function dispatchUpdateAppActivities ({ deviceId, action, cache }:
if (action.removed.length > 0) {
const chunks = chunk(action.removed, 500)
for (let i = 0; i < chunks.length; i++) {
const items = chunks[i]
for (const items of chunks) {
await cache.database.appActivity.destroy({
where: {
familyId: cache.familyId,