<commit_before>var MultiPart = require("JSss")("com.something.test","MyAccessKey","mySecret","dirOnS3/fileOnS3.zip", { useSSL:true,dataIntegrityEnabled:true,rrsEnabled:false }),
    fs = require('fs'),
    functionQueue = require('function-queue') /*requires module 'function-queue' published on npm registry*/;
//Local ivars
var filepath = "/Users/user/fileToUpload.zip",
    partFinished = 0,
    waitingQueue = null;

//
MultiPart.on("jsss-end",function () { console.log("end"); });
MultiPart.on("jsss-error",function (err) { console.log(err); });
MultiPart.on("jsss-upload-notice",function (partNumber,status,err) {
  partFinished++;
    if (status == false) { 
      console.log("Finished upload " + partNumber + " with error: " + require('util').inspect(err) + "\n");
      console.log("Aborting..."); 
      MultiPart.abortUpload(); 
    } else { 
      console.log("Finished upload " + partNumber + " with success\n");
      waitingQueue(); /*next in upload queue*/ 
    }
});
//Must be registered to MultiPart API start
console.log("Requesting upload ID...\n");
MultiPart.on("jsss-ready",function () {
  console.log("Ready to upload, fetching file data...\n");
  //Reset ivars
  var uploadQueue = functionQueue();
  
  //Open file
  fs.open(filepath, 'r', function(err, fd) {
    abortOnError(err); //abort if error
    //get size of
    fs.fstat(fd, function(err2, stats) {
        abortOnError(err2); //abort if error
        var bufferSize=stats.size, chunkSize=(100*1024*1024) /*100MB in bits*/, bytesRead=0, chunkCount=0;<commit_msg>update queued test with retry..<commit_after>#!/usr/local/bin/node
//var fileName = "test.zip";
var MultiPart = require("JSss")("com.something.test","MyAccessKey","mySecret","dirOnS3/fileOnS3.zip", { useSSL:true,dataIntegrityEnabled:true,rrsEnabled:false }),
    fs = require('fs'),
    functionQueue = require('function-queue');
//Local ivars
    var fileName = "file.zip";
    var filepath = "/home/user/" + fileName,
    partFinished = 0,
    waitingQueue = null,
    uploadQueue = functionQueue();

//
MultiPart.on("jsss-end",function () { console.log("end"); });
MultiPart.on("jsss-error",function (err) { console.log(err); });
MultiPart.on("jsss-upload-notice",function (partNumber,status,err) {
    if (status == false) { 
      console.log("Finished upload " + partNumber + " with error: " + require('util').inspect(err) + "\n");
      console.log("Retrying..."); 
      uploadQueue.nextInQueue(); //re-call bext in queue
    } else { 
      partFinished++;
      console.log("Finished upload " + partNumber + " with success\n");
      waitingQueue(); /*next in upload queue*/ 
    }
});
//Must be registered to MultiPart API start
console.log("Requesting upload ID...\n");
MultiPart.on("jsss-ready",function () {
  console.log("Ready to upload, fetching file data...\n");
  //Open file
  fs.open(filepath, 'r', function(err, fd) {
    abortOnError(err); //abort if error
    //get size of
    fs.fstat(fd, function(err2, stats) {
        abortOnError(err2); //abort if error
        var bufferSize=stats.size, chunkSize=(100*1024*1024) /*100MB in bits*/, bytesRead=0, chunkCount=0;
{'fraction_non_alphanumeric': 0.17660184890022315, 'fraction_numerical': 0.0133885878227606, 'mean_word_length': 3.805513016845329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3803798', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1018, 'n_words': 215}