Skip to content

Commit dcfeaf5

Browse files
committed
feat: remove logging of success jobs in Jobs table
1 parent 918cc9d commit dcfeaf5

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

datajoint/autopopulate.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,15 +600,6 @@ def purge_jobs(self):
600600
"""
601601
invalid_removed = 0
602602

603-
success_query = self.jobs & {"table_name": self.target.table_name} & "status = 'success'"
604-
if success_query:
605-
invalid_success = len(success_query) - len(self.target)
606-
if invalid_success > 0:
607-
for key, job_key in zip(*success_query.fetch("KEY", "key")):
608-
if not (self.target & job_key):
609-
(self.jobs & key).delete()
610-
invalid_removed += 1
611-
612603
incomplete_query = self.jobs & {"table_name": self.target.table_name} & "status != 'success'"
613604
if incomplete_query:
614605
keys2do = self._jobs_to_do({}).fetch("KEY")

datajoint/jobs.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -185,40 +185,16 @@ def ignore(self, table_name, key, message=""):
185185

186186
return True
187187

188-
def complete(self, table_name, key, run_duration=None, run_metadata=None):
188+
def complete(self, table_name, key):
189189
"""
190190
Log a completed job. When a job is completed, its reservation entry is deleted.
191191
192192
Args:
193193
table_name: `database`.`table_name`
194194
key: the dict of the job's primary key
195-
run_duration: duration in second of the job run
196-
run_metadata: dict containing metadata about the run (e.g. code version, environment info)
197195
"""
198196
job_key = dict(table_name=table_name, key_hash=key_hash(key))
199-
if self & job_key:
200-
current_status = (self & job_key).fetch1("status")
201-
if current_status == "success":
202-
return
203-
204-
with config(enable_python_native_blobs=True):
205-
self.insert1(
206-
dict(
207-
table_name=table_name,
208-
key_hash=key_hash(key),
209-
status="success",
210-
host=platform.node(),
211-
pid=os.getpid(),
212-
connection_id=self.connection.connection_id,
213-
user=self._user,
214-
key=_jsonify(key),
215-
run_duration=run_duration,
216-
run_metadata=_jsonify(run_metadata) if run_metadata else None,
217-
timestamp=datetime.datetime.utcnow(),
218-
),
219-
replace=True,
220-
ignore_extra_fields=True,
221-
)
197+
(self & job_key).delete()
222198

223199
def error(self, table_name, key, error_message, error_stack=None, run_duration=None, run_metadata=None):
224200
"""

0 commit comments

Comments
 (0)