1
0
forked from ALHP/ALHP.GO

Hash each PKGBUILD and compare before parsing, fixes #25

This will speed things up significantly. See #25 for more information and discussion.
This commit is contained in:
2021-08-30 11:02:06 +02:00
parent 1977181409
commit b78b09aeaa
12 changed files with 375 additions and 28 deletions

View File

@@ -142,6 +142,20 @@ func (dpc *DbPackageCreate) SetNillableUpdated(t *time.Time) *DbPackageCreate {
return dpc
}
// SetHash sets the "hash" field.
func (dpc *DbPackageCreate) SetHash(s string) *DbPackageCreate {
dpc.mutation.SetHash(s)
return dpc
}
// SetNillableHash sets the "hash" field if the given value is not nil.
func (dpc *DbPackageCreate) SetNillableHash(s *string) *DbPackageCreate {
if s != nil {
dpc.SetHash(*s)
}
return dpc
}
// Mutation returns the DbPackageMutation object of the builder.
func (dpc *DbPackageCreate) Mutation() *DbPackageMutation {
return dpc.mutation
@@ -354,6 +368,14 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
})
_node.Updated = value
}
if value, ok := dpc.mutation.Hash(); ok {
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
Type: field.TypeString,
Value: value,
Column: dbpackage.FieldHash,
})
_node.Hash = value
}
return _node, _spec
}