Example #1
0
func createFakeLock(repo *repository.Repository, t time.Time, pid int) (backend.ID, error) {
	hostname, err := os.Hostname()
	if err != nil {
		return backend.ID{}, err
	}

	newLock := &restic.Lock{Time: t, PID: pid, Hostname: hostname}
	return repo.SaveJSONUnpacked(backend.Lock, &newLock)
}
Example #2
0
func createFakeLock(repo *repository.Repository, t time.Time, pid int) (backend.ID, error) {
	newLock := &restic.Lock{Time: t, PID: pid}
	return repo.SaveJSONUnpacked(backend.Lock, &newLock)
}