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

Issue log message on upload #2571

Merged
merged 1 commit into from Jan 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion girder/models/upload.py
Expand Up @@ -21,7 +21,7 @@
import six
from bson.objectid import ObjectId

from girder import events
from girder import events, logger
from girder.api import rest
from girder.constants import SettingKey
from .model_base import Model
Expand Down Expand Up @@ -243,6 +243,9 @@ def finalizeUpload(self, upload, assetstore=None):
if '_id' in upload:
self.remove(upload)

logger.info('Upload complete. Upload=%s File=%s User=%s' % (
upload['_id'], file['_id'], upload['userId']))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add the size and/or the name of the file? When trying to determine files of interest, these could help.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include any actual metadata about the file itself in the log, it seems more useful to just retain its ID and we could lookup the full metadata from the database via a script if needed.

Since much of the metadata is mutable, I figured we would be better off just using this as a way to do lookups into the database. Probably any analysis we'll want to perform will involve data munging from disparate sources.


# Add an async event for handlers that wish to process this file.
eventParams = {
'file': file,
Expand Down