Skip to content

Commit

Permalink
chore: Comment removal
Browse files Browse the repository at this point in the history
Removed commented out logdebugs
  • Loading branch information
EthanFreestone committed Oct 29, 2024
1 parent 68e24d8 commit 680aab2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,11 @@ class PackageIngestService implements DataBinder {
// ENSURE MDC title is set as early as possible
MDC.put('title', StringUtils.truncate(pc.title.toString()))

// log.debug("Try to resolve ${pc}")

try {
PackageContentItem.withNewSession { tsess ->
PackageContentItem.withNewTransaction { status ->
// Delegate out to TitleIngestService so that any shared steps can move there.
Map titleIngestResult = titleIngestService.upsertTitle(pc, kb, trustedSourceTI)
//log.debug("LOGDEBUG RESOLVED TITLE: ${titleIngestResult}")
// titleIngestResult.titleInstanceId will be non-null IFF TitleIngestService managed to find a title with that Id.
if ( titleIngestResult.titleInstanceId != null ) {
// Pass off to new hierarchy method (?)
Expand Down Expand Up @@ -292,7 +289,7 @@ class PackageIngestService implements DataBinder {
public Pkg lookupPkgAndUpdate(PackageSchema package_data) {
Pkg pkg = lookupPkg(package_data)
Org vendor = getVendorFromPackageData(package_data)
// FIXME do update step but NOT create step
// Do update step but NOT create step
if (pkg != null) {
pkg.sourceDataUpdated = package_data.header.sourceDataUpdated

Expand Down Expand Up @@ -510,7 +507,6 @@ class PackageIngestService implements DataBinder {
}

Platform platform = Platform.resolve(platform_url_to_use, pc.platformName)
// log.debug("Platform: ${platform}")

if ( platform == null && PROXY_MISSING_PLATFORM ) {
platform = Platform.resolve('http://localhost.localdomain', 'This platform entry is used for error cases')
Expand Down Expand Up @@ -563,8 +559,6 @@ class PackageIngestService implements DataBinder {
pciStatus: 'none' // This should be 'none', 'updated' or 'new'
]

// log.debug("platform ${pc.platformUrl} ${pc.platformName} (item URL is ${pc.url})")

// lets try and work out the platform for the item
Platform platform = lookupOrCreatePlatform(pc);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ order by pj.dateCreated
org.slf4j.MDC.clear()
org.slf4j.MDC.setContextMap( jobId: '' + jid, tenantId: '' + tid, 'tenant': '' + tenantName)
JobContext.current.set(new JobContext( jobId: jid, tenantId: tid ))
//log.debug("LOGDEBUG TID: ${tId}")
Tenants.withId(tid) {
beginJob(jid)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ class PushKBService implements DataBinder {
updatedAccessEnd: 0,
]
KBIngressType ingressType = kbManagementBean.ingressType
//log.debug("pushPCIs (Service) called")
if (ingressType == KBIngressType.PushKB) {
try {
pcis.each { Map record ->
//log.debug("PCI record: ${record}")

// Handle MDC directly? Might not be the right approach
MDC.put('title', StringUtils.truncate(record.title.toString()))
Expand All @@ -130,22 +128,17 @@ class PushKBService implements DataBinder {
pc.instanceMedium = 'Electronic'
}

//log.debug("BeforeBind")
bindData(pc, record)
//log.debug("AfterBind")
if (utilityService.checkValidBinding(pc)) {
//log.debug("IsValid")
try {
Pkg pkg = null;
Pkg.withSession { currentSess ->
Pkg.withTransaction {
Pkg.withNewSession { newSess ->
Pkg.withTransaction {
// TODO this will allow the PCI data to update the PKG record... do we want this?
//log.debug("Before package look")

pkg = packageIngestService.lookupOrCreatePackageFromTitle(pc);
//log.debug("LOGGING PACKAGE OBTAINED FROM PCI: ${pkg}")
}
newSess.clear()
}
Expand All @@ -157,23 +150,20 @@ class PushKBService implements DataBinder {
TitleInstance.withNewSession { newSess ->
TitleInstance.withTransaction {
Map titleIngestResult = titleIngestService.upsertTitleDirect(pc)
//log.debug("LOGGING titleIngestResult: ${titleIngestResult}")

if ( titleIngestResult.titleInstanceId != null ) {
//log.debug("Before lookupOrCreateTitleHierarchy")

Map hierarchyResult = packageIngestService.lookupOrCreateTitleHierarchy(
titleIngestResult.titleInstanceId,
pkg.id,
true,
pc,
result.updateTime,
result.titleCount // FIXME not sure about this
result.titleCount // Not totally sure this is valuable here
)

PackageContentItem pci = PackageContentItem.get(hierarchyResult.pciId)
packageIngestService.hierarchyResultMapLogic(hierarchyResult, result, pci)
//log.debug("After lookupOrCreateTitleHierarchy")

/* TODO figure out if use of removedTimestamp
* should be something harvest also needs to do directly
Expand Down Expand Up @@ -208,7 +198,6 @@ class PushKBService implements DataBinder {
String message = "Skipping \"${pc.title}\". System error: ${e.message}"
log.error(message,e)
}
//log.debug("Near end") // FIXME seems to be taking 0.1s from log.debug("After lookupOrCreateTitleHierarchy")???

result.titleCount++

Expand Down Expand Up @@ -239,7 +228,6 @@ class PushKBService implements DataBinder {
result.errorMessage = "pushPCIs not valid when kbManagementBean is configured with type (${ingressType})"
}

//log.debug("Before return")
return result
}
}

0 comments on commit 680aab2

Please sign in to comment.