({
account_id,
file_location,
fullSync,
logger,
}: SyncJobType & { logger: Logger })
| 150 | } |
| 151 | |
| 152 | export async function syncJob({ |
| 153 | account_id, |
| 154 | file_location, |
| 155 | fullSync, |
| 156 | logger, |
| 157 | }: SyncJobType & { logger: Logger }) { |
| 158 | const accountId = account_id; |
| 159 | const fileLocation = file_location; |
| 160 | |
| 161 | const account = await prisma.accounts.findUnique({ |
| 162 | where: { |
| 163 | id: accountId, |
| 164 | }, |
| 165 | include: { |
| 166 | discordAuthorizations: true, |
| 167 | slackAuthorizations: true, |
| 168 | }, |
| 169 | }); |
| 170 | |
| 171 | const syncFunction = fileLocation |
| 172 | ? slackSyncWithFiles |
| 173 | : identifySyncType(account); |
| 174 | |
| 175 | await syncFunction({ |
| 176 | accountId, |
| 177 | fullSync, |
| 178 | fileLocation, |
| 179 | logger, |
| 180 | }); |
| 181 | } |
nothing calls this directly
no test coverage detected