-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EPMRPP-95621 || Pattern-Analysis doesn't work on Launch finish when A…
…A finished working
- Loading branch information
1 parent
e059e0e
commit 3190bc4
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,20 @@ | |
import com.epam.ta.reportportal.core.events.handler.ConfigurableEventHandler; | ||
import com.epam.ta.reportportal.core.events.subscriber.EventSubscriber; | ||
import com.epam.ta.reportportal.core.project.config.ProjectConfigProvider; | ||
import com.epam.ta.reportportal.ws.converter.resource.handler.attribute.launch.LaunchResourceAttributeLogger; | ||
import java.util.List; | ||
import java.util.Map; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Ivan Budayeu</a> | ||
*/ | ||
public class ProjectConfigDelegatingSubscriber<T extends ProjectIdAwareEvent> implements | ||
EventSubscriber<T> { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ProjectConfigDelegatingSubscriber.class); | ||
|
||
private final ProjectConfigProvider projectConfigProvider; | ||
private final List<ConfigurableEventHandler<T, Map<String, String>>> eventHandlers; | ||
|
||
|
@@ -41,6 +46,12 @@ public ProjectConfigDelegatingSubscriber(ProjectConfigProvider projectConfigProv | |
@Override | ||
public void handleEvent(T event) { | ||
final Map<String, String> projectConfig = projectConfigProvider.provide(event.getProjectId()); | ||
eventHandlers.forEach(h -> h.handle(event, projectConfig)); | ||
eventHandlers.forEach(h -> { | ||
try { | ||
h.handle(event, projectConfig); | ||
} catch (Exception e) { | ||
LOGGER.debug("Error while processing event: " + e.getMessage()); | ||
} | ||
}); | ||
} | ||
} |