MCPcopy
hub / github.com/saltstack/salt / updated

Function updated

salt/cache/mysql_cache.py:352–366  ·  view source on GitHub ↗

Return the integer Unix epoch update timestamp of the specified bank and key.

(bank, key)

Source from the content-addressed store, hash-verified

350
351
352def updated(bank, key):
353 """
354 Return the integer Unix epoch update timestamp of the specified bank and
355 key.
356 """
357 _init_client()
358 query = (
359 "SELECT UNIX_TIMESTAMP(last_update) FROM {} WHERE bank=%s "
360 "AND etcd_key=%s".format(__context__["mysql_table_name"])
361 )
362 data = (bank, key)
363 cur, _ = run_query(__context__.get("mysql_client"), query=query, args=data)
364 r = cur.fetchone()
365 cur.close()
366 return int(r[0]) if r else r

Callers

nothing calls this directly

Calls 5

formatMethod · 0.80
_init_clientFunction · 0.70
run_queryFunction · 0.70
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected