コード例 #1
0
func (ls *Libstore) RevokeLease(args *sp.RevokeLeaseArgs, reply *sp.RevokeLeaseReply) error {
	ok := ls.leases.Revoke(args.Key)
	if ok {
		reply.Status = sp.OK
	} else {
		reply.Status = sp.EKEYNOTFOUND
	}
	return nil
}
コード例 #2
0
// Make StorageTester CacheRPC-able
func (st *StorageTester) RevokeLease(args *storageproto.RevokeLeaseArgs, reply *storageproto.RevokeLeaseReply) error {
	//fmt.Printf("Revoke Msg received %s\n", args.Key)
	st.recv_revoke[args.Key] = true
	st.comp_revoke[args.Key] = false
	time.Sleep(time.Duration(st.delay*1000) * time.Millisecond)
	st.comp_revoke[args.Key] = true
	reply.Status = storageproto.OK
	return nil
}