Skip to content

Commit

Permalink
workflow: remove previously_rejected to accept updates
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Cesarano <[email protected]>

Removes the check that rejects records if already harvested more than
5 days ago.
  • Loading branch information
ammirate committed Sep 28, 2017
1 parent 20b4bf6 commit 924efd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
19 changes: 0 additions & 19 deletions inspirehep/modules/workflows/tasks/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,25 +247,6 @@ def already_harvested(obj, eng):
return False


def previously_rejected(days_ago=None):
"""Check if record exist on INSPIRE or already rejected."""
@with_debug_logging
@wraps(previously_rejected)
def _previously_rejected(obj, eng):
if days_ago is None:
_days_ago = current_app.config.get('INSPIRE_ACCEPTANCE_TIMEOUT', 5)
else:
_days_ago = days_ago

if is_too_old(obj.data, days_ago=_days_ago):
obj.log.info("Record is likely rejected previously.")
return True

return False

return _previously_rejected


@with_debug_logging
def pending_in_holding_pen(obj, eng):
"""Check if a record exists in HP by looking in given KB."""
Expand Down
12 changes: 0 additions & 12 deletions inspirehep/modules/workflows/workflows/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
pending_in_holding_pen,
article_exists,
already_harvested,
previously_rejected,
update_existing_workflow_object,
)
from inspirehep.modules.workflows.tasks.upload import store_record, set_schema
Expand Down Expand Up @@ -138,17 +137,6 @@
mark('stop', True),
]
),
# FIXME: This filtering step should be removed when:
# old previously rejected records are treated
# differently e.g. good auto-reject heuristics or better
# time based filtering (5 days is quite random now).
IF(
previously_rejected(),
[
mark('already-ingested', True),
mark('stop', True),
]
),
]
),
]
Expand Down

0 comments on commit 924efd1

Please sign in to comment.