diff --git a/ansible/molecule/default/verify.yml b/ansible/molecule/default/verify.yml index 1b3a436ca..4d7e30f4d 100644 --- a/ansible/molecule/default/verify.yml +++ b/ansible/molecule/default/verify.yml @@ -29,9 +29,9 @@ document: content: "{{ content }}" filename: "{{ filename }}.txt" - mime_type: text/plain headers: Authorization: 'Basic {{ (paperlessng_superuser_name + ":" + paperlessng_superuser_password) | b64encode }}' + Content-Type: text/plain return_content: yes register: post_document failed_when: "'OK' not in post_document.content" @@ -45,10 +45,6 @@ register: logs failed_when: "('Consuming ' + filename + '.txt') not in logs.content" - - name: sleep 5 seconds - pause: - seconds: 5 - - name: verify uploaded document has been consumed uri: url: "http://{{ paperlessng_listen_address }}:{{ paperlessng_listen_port }}/api/logs/" diff --git a/src/documents/views.py b/src/documents/views.py index b99bf11c7..7aadba36d 100755 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -383,6 +383,7 @@ class PostDocumentView(APIView): dir=settings.SCRATCH_DIR, delete=False) as f: f.write(doc_data) + f.flush() os.utime(f.name, times=(t, t)) async_task("documents.tasks.consume_file",