Commit 36248fcd authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

[ninjalog] don't upload ninja log of no-op build

Check timestamp of .ninja_log before upload and don't upload if mtime is very old.

Bug: 900161
Change-Id: I0cf00ae29e23a9f609564e4c12b4b518320ca23a
Reviewed-on: https://chromium-review.googlesource.com/c/1404611
Commit-Queue: Shinya Kawanaka <shinyak@chromium.org>
Reviewed-by: 's avatarShinya Kawanaka <shinyak@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
parent 4e23d9ba
......@@ -26,6 +26,7 @@ import platform
import socket
import subprocess
import sys
import time
from third_party import httplib2
......@@ -192,6 +193,12 @@ def main():
logging.warn("ninjalog is not found in %s", ninjalog)
return 1
# We assume that each ninja invocation interval takes at least 2 seconds.
# This is not to have duplicate entry in server when current build is no-op.
if os.stat(ninjalog).st_mtime < time.time() - 2:
logging.info("ninjalog is not updated recently %s", ninjalog)
return 0
output = cStringIO.StringIO()
with open(ninjalog) as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment