200 -> 16
Previously, considering the fibonacci back off strategy, if engine failed to
start it would have tried to attempt connections for 2.862799e+33 years.
Now, the amount of attempts is 16, equivalent to around 2 and a half seconds.
Should be more than enough, considering that usually 6-7 attempts are enough.
- added hook support (executed after parsing config but before
starting engine)
- made db resets configurable
- merged config parsing helper with the main Setup function
- removed engineDelay parameter
- replaced t.Log with t.Error for engine process kill error
- improved option comments
NewFileCSVStorage() now returns an error besides the storage struct itself, which is
logged and returned instead of calling log.Fatal() which was causing the engine to
crash.
Fixed compilation errors by creating the CSVStorage separately and passing it as an
argument to the TpReader constructor.
Fixes#3962
Moved engine/cdr.go to utils/cdr.go.
Moved engine/cdrs.go and engine/cdrs_test.go to cdrs package.
Moved api functions from cdrs/cdrs.go to cdrs/apis.go. Same for the
tests.
Deleted CDRsV1 type and its methods.
Updated mongo indexing for cdrs to take into consideration only the
opts.*cdrID field.
Fixed cdrs_it_test.go test.
Before storing CDRs in CDR processEvents, we are now temporarily generating
the *cdrID in APIOpts (until we decide where this should happen).
Renamed to composeURI.
Use simple string concatenation to build URI because there is
no need to keep the Parse call as a validation step. Any issue
would be caught when establishing a connection.
- Set (but comment) serverAPI options (currently distinct api and
create.size BSON field are deprecated + possible others that are untested)
- Remove the custom time decoder used for mongo BSON
datetime values. The custom decoder was only converting these values
into UTC and was not any different from the default time.Time
decoder in the MongoDB driver, which also handles BSON string, int64,
and document values.
- Implement 'buildURL' function to connect to mongo (can also be
used for mysql and postgres)
- Update function names, variable names, and comments for clarity
- Replace 'bsonx.Regex' with the Regex primitive (deprecated since 1.12).
- Use simple concatenation instead of Sprintf
- Declare 'decimalType' locally, replace global 'decimalType'
- Simplify several functions without altering functionality
- Converting directly from a D to an M is deprecated. We are now decoding
directly in a M.
- Used errors.As and errors.Is for proper error comparison and assertion
- Revised sloppy reassignments and added missing error checks