mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-12-15 10:04:01 +08:00
feat(fs): fs change event notification via SSE / show panic stack trace in task queue
This commit is contained in:
@@ -57,6 +57,18 @@ func (f FileFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.FileMutation", m)
|
||||
}
|
||||
|
||||
// The FsEventFunc type is an adapter to allow the use of ordinary
|
||||
// function as FsEvent mutator.
|
||||
type FsEventFunc func(context.Context, *ent.FsEventMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f FsEventFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.FsEventMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.FsEventMutation", m)
|
||||
}
|
||||
|
||||
// The GroupFunc type is an adapter to allow the use of ordinary
|
||||
// function as Group mutator.
|
||||
type GroupFunc func(context.Context, *ent.GroupMutation) (ent.Value, error)
|
||||
|
||||
Reference in New Issue
Block a user