import { ITask } from 'pg-promise' ; import db from '../../db' ; const serializableMode = new db . $config . pgp . txMode . TransactionMode ( { tiLevel : db . $config . pgp . txMode . isolationLevel . serializable , readOnly : false } ) ; export function startUpdateTransaction < T > ( cb ) { return db . tx ( { mode : serializableMode } , cb ) ; }