-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #14924: Cleanup unreferenced software #2231
Fixes #14924: Cleanup unreferenced software #2231
Conversation
Full(Unit) | ||
case Failure(msg, exception, chain) => mutSetSoftwares = Failure(msg, exception, chain) // otherwise the time is wrong | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ain't pretty, yet its more efficient
[2019-05-23 13:00:06] DEBUG com.normation.inventory.ldap.core.SoftwareServiceImpl - All softwares id in nodes fetched: 37953 softwares id in 10029ms, compared to what is in the TODO below
[2019-05-23 12:55:17] DEBUG com.normation.inventory.ldap.core.SoftwareServiceImpl - All softwares id in nodes fetched: 37953 softwares id in 15197ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is surely non idiomatic, and i fail to improve it
fe7bf28
to
4bb4a0d
Compare
Commit modified |
@@ -146,7 +146,7 @@ along with Rudder. If not, see <http://www.gnu.org/licenses/>. | |||
are doing. | |||
--> | |||
|
|||
<root level="info"> | |||
<root level="debug"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should not be modified
@@ -360,7 +360,7 @@ along with Rudder. If not, see <http://www.gnu.org/licenses/>. | |||
================ | |||
This logger is in charge of all scheduled jobs and batches | |||
--> | |||
<logger name="scheduledJob" level="info" additivity="false"> | |||
<logger name="scheduledJob" level="debug" additivity="false"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neither that
4bb4a0d
to
4517d59
Compare
Commit modified |
|
||
batchedNodes = nodes.grouped(50) | ||
|
||
_ = batchedNodes.foreach { nodeEntries: Seq[LDAPEntry] => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should not be a foreach, else we loose the maybe Failure
: res <- sequence(batchedNodes) { .... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried using a sequence on batchedNodes, without success (it's an iterator, I cannot sequence it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do:
batchedNodes = con.searchSub(acceptedDit.NODES.dn.getParent, IS(OC_NODE), A_NODE_UUID).grouped(50).toSeq
res <- sequence(batchedNodes) { nodeEntries: Seq[LDAPEntry] =>
You still process nodes 50 by 50, and don't hold more node ids than previously
db1e062
to
fd62862
Compare
Commit modified |
This PR is not mergeable to upper versions. |
OK, merging this PR |
https://issues.rudder.io/issues/14924