import setupLogger from '@/config/logger' ; import { policies , types } from 'cassandra-driver' ; const { retry } = policies ; const { RetryPolicy } = retry ; const logger = setupLogger ( module ) ; /**
 * Custom retry policy that explicitly prevents retries.
 */ export default class NoRetryPolicy extends RetryPolicy { public onReadTimeout ( requestInfo , _consistency , _received , _blockFor , _isDataPresent ) { const query = requestInfo ? requestInfo . query : 'N/A' ; logger . error ( `readTimeout: ${ query }` ) ; return this . rethrowResult ( ) ; } public onUnavailable ( requestInfo , _consistency , _required , _alive ) { const query = requestInfo ? requestInfo . query : 'N/A' ; logger . error ( `unavailable: ${ query }` ) ; return this . rethrowResult ( ) ; } public onWriteTimeout ( requestInfo , _consistency , _received , _blockFor , _writeType ) { const query = requestInfo ? requestInfo . query : 'N/A' ; logger . error ( `writeTimeout: ${ query }` ) ; return this . rethrowResult ( ) ; } }