MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / acknowledge

Method acknowledge

web/pgadmin/misc/bgprocess/processes.py:800–821  ·  view source on GitHub ↗

Acknowledge from the user, he/she has alredy watched the status. Update the acknowledgement status, if the process is still running. And, delete the process information from the configuration, and the log files related to the process, if it has already been complete

(_pid)

Source from the content-addressed store, hash-verified

798
799 @staticmethod
800 def acknowledge(_pid):
801 """
802 Acknowledge from the user, he/she has alredy watched the status.
803
804 Update the acknowledgement status, if the process is still running.
805 And, delete the process information from the configuration, and the log
806 files related to the process, if it has already been completed.
807 """
808 p = Process.for_user(pid=_pid).first()
809
810 if p is None:
811 raise LookupError(PROCESS_NOT_FOUND)
812
813 if p.end_time is not None:
814 logdir = p.logdir
815 db.session.delete(p)
816 import shutil
817 shutil.rmtree(logdir, True)
818 else:
819 p.acknowledge = get_current_time()
820
821 db.session.commit()
822
823 def set_env_variables(self, server, **kwargs):
824 """Set environment variables"""

Callers 2

acknowledgeFunction · 0.45

Calls 4

for_userMethod · 0.80
get_current_timeFunction · 0.70
firstMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected