Skip to content
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

Don't process items if no Language Processing features are enabled #249

Merged
merged 3 commits into from
Oct 26, 2020

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Oct 22, 2020

Description of the Change

This PR adds a new helper function that will check to see if any Language Processing features are enabled. This function is then used as one more check to determine if we should run Language Processing on items.

If we are saving a post type that is supported and is published (which are the existing checks), we now also check to make sure we have at least on Language Processing feature enabled. This ensures we don't make an API request that isn't needed.

Alternate Designs

None

Benefits

Saving items is now faster, as we're not making unnecessary API requests.

Possible Drawbacks

None

Verification Process

  1. Go to the Language Processing settings
  2. Enable processing on Posts
  3. Disable all features below that
  4. Go save a new post and see that the save process completes quickly

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#248

…sing features are enabled. Use this to dtermine if we should classify an item during save
@dkotter dkotter self-assigned this Oct 22, 2020
@jeffpaul jeffpaul added this to the 1.6.0 milestone Oct 23, 2020
@jeffpaul jeffpaul added the type:bug Something isn't working. label Oct 23, 2020
@jeffpaul jeffpaul merged commit abf82ae into develop Oct 26, 2020
@jeffpaul jeffpaul deleted the feature/ensure-features-enabled branch October 26, 2020 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If post type is enabled but no features are enabled, requests to Watson still happen on save
3 participants