(action, count, err)
| 4 | const CLASS_NAME = '_Installation'; |
| 5 | |
| 6 | function logResult(action, count, err) { |
| 7 | if (err && err.code === Parse.Error.OBJECT_NOT_FOUND) { |
| 8 | logger.verbose(`Installation dedup ${action} matched no rows; nothing to do.`); |
| 9 | return; |
| 10 | } |
| 11 | if (err && err.code === Parse.Error.OPERATION_FORBIDDEN) { |
| 12 | logger.warn( |
| 13 | `Installation dedup ${action} skipped: caller has no permission to ${action} the conflicting row(s). The conflicting row remains.` |
| 14 | ); |
| 15 | return; |
| 16 | } |
| 17 | if (err) { |
| 18 | logger.error(`Installation dedup ${action} failed: ${err.message || err}`); |
| 19 | return; |
| 20 | } |
| 21 | logger.verbose( |
| 22 | `Installation dedup ${action} applied to ${count == null ? 'matching' : count} conflicting row(s).` |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | async function performAction({ |
| 27 | database, |
no test coverage detected