Example #1
0
 def commit(self):
     """Commit current transaction. Calls SQL `COMMIT`."""
     self.sql("commit")
     frappe.local.rollback_observers = []
     self.flush_realtime_log()
     enqueue_jobs_after_commit()
     flush_local_link_count()
Example #2
0
	def commit(self):
		"""Commit current transaction. Calls SQL `COMMIT`."""
		self.sql("commit")
		frappe.local.rollback_observers = []
		self.flush_realtime_log()
		enqueue_jobs_after_commit()
		flush_local_link_count()
Example #3
0
    def commit(self):
        """Commit current transaction. Calls SQL `COMMIT`."""
        for method in frappe.local.before_commit:
            frappe.call(method[0], *(method[1] or []), **(method[2] or {}))

        self.sql("commit")

        frappe.local.rollback_observers = []
        self.flush_realtime_log()
        enqueue_jobs_after_commit()
        flush_local_link_count()
			if(not d and key != frappe.scrub(key)):
				d = defaults.get(frappe.scrub(key), None)
			return d
		else:
			return frappe.defaults.get_defaults(parent)

	def begin(self):
		self.sql("start transaction")

	def commit(self):
		"""Commit current transaction. Calls SQL `COMMIT`."""
		self.sql("commit")
		frappe.local.rollback_observers = []
		self.flush_realtime_log()
		self.enqueue_global_search()
		flush_local_link_count()

	def enqueue_global_search(self):
		if frappe.flags.update_global_search:
			try:
				frappe.enqueue('frappe.utils.global_search.sync_global_search',
					now=frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_migrate,
					flags=frappe.flags.update_global_search)
			except redis.exceptions.ConnectionError:
				sync_global_search()

			frappe.flags.update_global_search = []

	def flush_realtime_log(self):
		for args in frappe.local.realtime_log:
			frappe.async.emit_via_redis(*args)