File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -589,11 +589,17 @@ class Monitoring {
589589 var update_data = null ;
590590 var last_item = null ;
591591 var trans = null ;
592+ var use_trans = ! ! this . config . getPath ( 'Storage.transactions' ) ;
592593
593594 async . series (
594595 [
595596 function ( callback ) {
596- // begin transaction
597+ // begin transaction if enabled, otherwise use direct storage
598+ if ( ! use_trans ) {
599+ trans = self . storage ;
600+ return callback ( ) ;
601+ }
602+
597603 self . storage . begin ( timeline_key , function ( err , transaction ) {
598604 trans = transaction ;
599605 callback ( ) ;
@@ -684,12 +690,15 @@ class Monitoring {
684690 } ,
685691 function ( callback ) {
686692 // commit our transaction
693+ if ( ! use_trans ) return callback ( ) ;
687694 trans . commit ( callback ) ;
688695 }
689696 ] ,
690697 function ( err ) {
691698 if ( err ) {
692699 // abort transaction and bubble error up
700+ if ( ! use_trans ) return callback ( err ) ;
701+
693702 return trans . abort ( function ( ) {
694703 callback ( err ) ;
695704 } ) ;
You can’t perform that action at this time.
0 commit comments