constants are requested to server script

parent eab67c55
require_relative 'filelogger' require_relative 'filelogger'
require 'digest/md5' require 'digest/md5'
require 'fileutils' require 'fileutils'
require 'open-uri'
# class that handles dataset tasks report # class that handles dataset tasks report
class DatasetUtils class DatasetUtils
begin
uri = URI(URI.escape("https://softinst104003.host.vifib.net/erp5/getIngestionConstantsJson"))
res = open(uri).read
json = JSON.parse(res)
EOF = json['split_end_suffix']
NONE_EXT = json['none_extension']
REFERENCE_SEPARATOR = json['reference_separator']
rescue
EOF = "EOF"
NONE_EXT = "none"
REFERENCE_SEPARATOR = "/"
end
DATASET_REPORT_FILE = ".dataset-task-report" DATASET_REPORT_FILE = ".dataset-task-report"
DATASET_TEMP_REPORT_FILE = ".temp-dataset-task-report" DATASET_TEMP_REPORT_FILE = ".temp-dataset-task-report"
DATASET_COMPLETED_FILE = ".dataset-completed" DATASET_COMPLETED_FILE = ".dataset-completed"
...@@ -42,10 +56,7 @@ class DatasetUtils ...@@ -42,10 +56,7 @@ class DatasetUtils
OUTPUT_RENAMED = "renamed: " OUTPUT_RENAMED = "renamed: "
MEGA = 1000000 MEGA = 1000000
EOF = "EOF"
CHUNK_SIZE = 50000000 #50mb CHUNK_SIZE = 50000000 #50mb
NONE_EXT = "none"
REFERENCE_SEPARATOR = "/"
RECORD_SEPARATOR = ";" RECORD_SEPARATOR = ";"
DATE_FORMAT = "%Y-%m-%d-%H-%M-%S" DATE_FORMAT = "%Y-%m-%d-%H-%M-%S"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment