因此,我们在Jenkins CI构建管理器上使用Gerrit Trigger(2.23.0)并使用docker容器进行实际构建.
Gerrit Repo轮询最近出现在我们的一些分支机构中的问题是失败并导致它每次都"检测到变化",所以尽管没有变化,它仍在不断重建.
检查Gerrit Repo Polling Log以查找任何受影响的作业,并提供以下输出之一:
Started on Feb 1, 2017 3:12:25 PM
Polling SCM changes on aosp-host
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: cannot obtain manifest http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git
Done. Took 1 min 19 sec
Changes found
Run Code Online (Sandbox Code Playgroud)
或者,如果构建已经构建(gerrit在进行scm轮询之前等待构建完成)
Started on Feb 2, 2017 3:24:15 AM
Polling SCM changes on aosp-host
[workspace] $ repo init -u …Run Code Online (Sandbox Code Playgroud) 我在标签中有一个图像,我希望在按下按钮时更改该图像,但不是更改图像,而是窗口变为空白:
from tkinter import *
from PIL import Image,ImageTk
import os
root = Tk()
root.state("zoomed")
def chng():
photo2 = ImageTk.PhotoImage(Image.open("upload.jpg"))
img.config(image = photo2)
img.grid()
photo = ImageTk.PhotoImage(Image.open("cat.jpg"))
img = Label(root,image = photo)
upload = Button(root, text= "Upload" ,height = 3, width = 12, command =
chng)
upload.grid( )
for col_num in range(root.grid_size()[1]):
root.columnconfigure(col_num, minsize=600)
for row_num in range(root.grid_size()[1]):
root.rowconfigure(row_num, minsize=60)
img.grid()
root.mainloop()
Run Code Online (Sandbox Code Playgroud) 我正在使用python为Minecraft pi版制作一个数字时钟.我正在使用包含大量代码的单个while循环 - 执行一次运行需要很短的时间,但它比我想要的还要多几毫秒,这对我的时钟造成了严重破坏.有没有办法让while循环完全准确?我正在使用两个计数time.sleep(1),但执行时间超过两秒.
例:
while True:
start = time.time()
for _ in range(5):
1000**3
time.sleep(1)
print (time.time() - start)
Run Code Online (Sandbox Code Playgroud)
每个循环需要超过1秒.
1.00102806091
1.00028204918
1.00103116035
1.00051879883
1.0010240078
1.00102782249
Run Code Online (Sandbox Code Playgroud)
此错误随着时间累积.我怎样才能防止漂移?