(self, commit=False)
| 1633 | return uploaded |
| 1634 | |
| 1635 | def update_size(self, commit=False): |
| 1636 | try: |
| 1637 | total_bytes = 0 |
| 1638 | for dirpath, _, filenames in os.walk(self.task_path()): |
| 1639 | for f in filenames: |
| 1640 | fp = os.path.join(dirpath, f) |
| 1641 | if not os.path.islink(fp): |
| 1642 | total_bytes += os.path.getsize(fp) |
| 1643 | self.size = (total_bytes / 1024 / 1024) |
| 1644 | if commit: self.save() |
| 1645 | |
| 1646 | self.project.owner.profile.clear_used_quota_cache() |
| 1647 | except Exception as e: |
| 1648 | logger.warn("Cannot update size for task {}: {}".format(self, str(e))) |
| 1649 | |
| 1650 | |
| 1651 | def get_task_assets_cache(self): |
no test coverage detected