That might be enough. But I'd almost think _next_uniq is safer.
or as-safe.
EyePulp_
baudehlo: that's fine. when I was having queue issues I was looking for some consistent identifier, and the uid can work that way across multiple attempts
baudehlo: I've re-added the counter
so we should be covered in both directions
baudehlo
I'd say you need 1 or the other.
not both.
Don't make it a longer filename :)
EyePulp_
=P The uid is nice for diagnostics because it doesn't change (and shows in the logs, etc), whereas the counter is nice for close to guaranteed collision prevention
I dropped the length of the uid a bit as well to keep the filename somewhat trim.
I agree with you that the counter is a good guarantee of uniqueness
knutix joined the channel
baudehlo
The counter doesn't change either does it?
What was the goal with this big renaming anyway?
I'm almost thinking it would be better as a separate file, now it's a lot more than just a simple regexp.
and a class perhaps, called HMailFname
so you can do new HMailFname(filename);
GitHubBot
[13Haraka] 15msimerson opened pull request #1784: lint: require space before function declaration (06master...06space-before-function-paren) 02https://github.com/haraka/Haraka/pull/1784
EyePulp_
one of the main goal was to get some aging indication / arrival times in the filename for quick/cheap stats and monitoring/alerting based on age rather than queue count
s/goal/goals
baudehlo
I see.
Yeah it'd be nice if file rename didn't change the creation time.
(maybe it doesn't?)
EyePulp_
the arrival time now is maintained across attempted resends
as the first element of the filename
Techinically it's arrival in the outbound queue, versus arrival in Haraka
baudehlo
Yup sure.
EyePulp_
I probably over-complicated it. But I do think an abstraction for managing the filename adds some safety to future outbound work-- even if my abstraction isn't the right one.
DoubleMalt joined the channel
baudehlo
What do you think about moving it to another .js file?
outbound.js is already HUGE
EyePulp_
It is. I was thinking the same about HMailItem
ultimatt
mkdir outbound; mv outbound.js outbound/index.js, and then let them breed like rabbits
refactoring outbound into smaller chunks would be a very good idea...
EyePulp_ definitely has some fears undertaking that
LOL, you're not alone..
but, with node's file loader, I think you can get away with the mv part I showed before and changing nothing else at all.
EyePulp_
It's pretty self contained, and I feel a lot more confident today than a month ago... but yeah, a little anxiety-inducing.
ultimatt
that just makes for a "natural" place for more outbound files to go, without littering the root path
EyePulp_
Si
baudehlo
Try it, see if it works :)
ultimatt
Crap, node 4 gets maintenance until April 2018...
Maybe that's what Haraka 3 can be about: requiring node 6, so that we can use more es6 features like this: var [operator, qty] = value.split(/\s+/);
13Haraka/06greenkeeper/haraka-plugin-karma-1.0.3 141e0b200 15greenkeeper[bot]: chore(package): update haraka-plugin-karma to version 1.0.3...
[13Haraka] 15msimerson closed pull request #1784: lint: require space before function declaration (06master...06space-before-function-paren) 02https://github.com/haraka/Haraka/pull/1784