Changed the ApplyDeltas signature

This commit is contained in:
l.albertalli 2015-02-10 18:17:54 -08:00
parent 50c3e5f93c
commit 472d86223e
8 changed files with 26 additions and 21 deletions

View file

@ -214,7 +214,7 @@ func (qs *QuadStore) updateLog(d graph.Delta) error {
return err
}
func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreDup, ignoreMiss bool) error {
func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreOpts graph.IgnoreOpts) error {
qs.session.SetSafe(nil)
ids := make(map[string]int)
// Pre-check the existence condition.
@ -226,7 +226,7 @@ func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreDup, ignoreMiss bool) e
switch d.Action {
case graph.Add:
if qs.checkValid(key) {
if ignoreDup {
if ignoreOpts.IgnoreDup {
continue
}else{
return graph.ErrQuadExists
@ -234,7 +234,7 @@ func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreDup, ignoreMiss bool) e
}
case graph.Delete:
if !qs.checkValid(key) {
if ignoreMiss {
if ignoreOpts.IgnoreMissing {
continue
}else{
return graph.ErrQuadNotExist