nl_tokens: very simple write repeater when gets error try repeat after 500ms but max 5 times
pl_tokens: function writeFile ( filePath , <mask> , callback , count ) { // callback(err) if ( typeof callback !== 'function' ) throw new Error ( 'Wrong arguments' ) ; filePath = path . resolve ( filePath ) ; count = count || 0 ; var maxLimit = 5 ; // 5 * 500ms = 2,5s fs . writeFile ( filePath , data , function ( err ) { if ( err ) { if ( count >= maxLimit ) callback ( new Error ( 'fsExt.writeFile: max repeat limit reached' ) . cause ( err ) ) ; // repeat limit reached else setTimeout ( function ( ) { writeFile ( filePath , data , callback , count + 1 ) ; } , 500 ) ; } else callback ( ) ; } ) ; }