Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const azureQueueService = require('../services/azure-queue.service')
const pinGenerationDataService = require('../services/data-access/pin-generation.data.service')
const featureToggles = require('feature-toggles')
const sb = require('@azure/service-bus')
const config = require('../config')
let sbClient
let sbQueueClient
let sbQueueSender
const redisPreparedChecks = featureToggles.isFeatureEnabled('_2020Mode')
if (redisPreparedChecks) {
sbClient = sb.ServiceBusClient.createFromConnectionString(config.ServiceBus.connectionString)
sbQueueClient = sbClient.createQueueClient('check-sync')
sbQueueSender = sbQueueClient.createSender()
}
const preparedCheckSyncService = {}
const redisEnabledBehaviour = async (pupilUrlSlug) => {
await sbQueueSender.send({
body: {
pupilUUID: pupilUrlSlug,
version: 1
}
})
}
const existingDefaultBehaviour = async (pupilUrlSlug) => {