Skip to content

Commit

Permalink
added notes about rq worker return values
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Apr 2, 2019
1 parent 6e43c3b commit dfde2be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions securedrop/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@

def srm(fn):
subprocess.check_call(['srm', '-r', fn])
# We need to return a non-`None` value so the rq worker writes this back to Redis
return "success"
1 change: 1 addition & 0 deletions securedrop/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def queued_add_checksum_for_file(db_model, model_id, file_path, db_uri):
session = sessionmaker(bind=create_engine(db_uri))()
db_obj = session.query(db_model).filter_by(id=model_id).one()
add_checksum_for_file(session, db_obj, file_path)
# We need to return a non-`None` value so the rq worker writes this back to Redis
return "success"


Expand Down
1 change: 1 addition & 0 deletions securedrop/tests/utils/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import time

# This is an arbitarily defined value in the SD codebase and not something from rqworker
REDIS_SUCCESS_RETURN_VALUE = 'success'


Expand Down

0 comments on commit dfde2be

Please sign in to comment.